Skip to content

Conversation

@Megasware128
Copy link
Contributor

Fixes bug which happens at least on Windows 10 where Wox is not hidden on startup when "Hide Wox on startup" is selected. It broke the tray icon so I fixed that too.

{
mainVM.MainWindowVisibility = Visibility.Visible;
}
mainVM.MainWindowVisibility = _settings.HideOnStartup ? Visibility.Hidden : Visibility.Visible;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this fixed hide on startup problem?
I didn't find any difference?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I put a breakpoint on if (!_settings.HideOnStartup) mainVM.MainWindowVisibility was already Visibility.Visible by default, which results in still showing the Wox window after startup when "Hide Wox on startup" is selected. I experienced this on two pc's both running Windows 10

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks
make sense
will merge after I off from work

@Megasware128
Copy link
Contributor Author

Hey @happlebao
Just asking what is the status of the merge of this fix? :)

bao-qian added a commit that referenced this pull request Jul 19, 2016
1. Fixed HideOnStartup
2. Fixed tray icon not showing up and hiding properly
@bao-qian bao-qian merged commit 64d917b into Wox-launcher:master Jul 19, 2016
bao-qian pushed a commit that referenced this pull request Jul 19, 2016
* Fixed HideOnStartup
* Fixed tray icon not showing up and hiding properly
@bao-qian
Copy link
Member

done. with a bit of rebase

@Megasware128 Megasware128 deleted the HideOnStartup branch July 20, 2016 10:55
@Megasware128
Copy link
Contributor Author

Megasware128 commented Jul 21, 2016

I think I also know why it failed before. This is my metadata on Windows 10
namespace System.Windows { public enum Visibility : byte { Visible = 0, Hidden = 1, Collapsed = 2 } }
Visible is the first value. Value 0. Which means it will be the default value on initialization. Maybe under Windows7/8 the metadata is different and it's in a different order and Hidden is the top result with 0?

@bao-qian
Copy link
Member

I don't know, but it doesn't matter. initialize everything explicitly is always the best option.

bao-qian pushed a commit that referenced this pull request Dec 19, 2017
* Fixed HideOnStartup
* Fixed tray icon not showing up and hiding properly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants