Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tray icon wrong color Windows 10 #597

Closed
tresf opened this issue Feb 28, 2020 · 9 comments · Fixed by #615
Closed

Tray icon wrong color Windows 10 #597

tresf opened this issue Feb 28, 2020 · 9 comments · Fixed by #615
Assignees
Labels
Milestone

Comments

@tresf
Copy link
Contributor

tresf commented Feb 28, 2020

I think we have some of our logic backwards, the tray icon on Windows 10 sometimes doesn't match the theme. I believe it's caused on a default Windows 10 install because when I click the theme options it seems to be corrected.

@tresf tresf added the bug label Feb 28, 2020
@tresf tresf added this to the 2.1.1 milestone Feb 28, 2020
@klabarge
Copy link
Member

klabarge commented Mar 4, 2020

I haven't been able to reproduce this yet. I reverted to a snapshot of a Windows 10 Pro 64-bit fresh installation. First install of QZ Tray honored the dark theme.

image

I will proceed with installing a VM from scratch to rule out any setting changes I may have made before the snapshot.

@klabarge
Copy link
Member

klabarge commented Mar 4, 2020

After a fresh install of Windows 10 Pro 1909 64-bit, I was still unable to reproduce the tray icon being the incorrect color. I tested using both AdoptOpenJDK 11.0.6 and Oracle Java 8u241.

Here's the default theme options for Windows 10 Pro 1909:

Choose your color: Custom
Choose your default Windows mode: Dark
Choose your default app mode: Light

Each combination of Dark/Light resulted in the correct color QZ Tray icon.

@tresf Do you have any additional information on the environment that reproduces this issue? Perhaps it's a specific version of Windows 10

@tresf
Copy link
Contributor Author

tresf commented Mar 4, 2020

@tresf Do you have any additional information on the environment that reproduces this issue? Perhaps it's a specific version of Windows 10

I think it is a specific version, or perhaps the consequence of an upgrade. I've seen this three times remoting into machines now, but never took the time to export these registry keys.

Thanks for the sanity check, at least we know it's correct out of the box. I'll close this for now and re-open once I can capture details from the environment which causes it.

@tresf tresf closed this as completed Mar 4, 2020
@tresf tresf reopened this Mar 19, 2020
@tresf
Copy link
Contributor Author

tresf commented Mar 19, 2020

@lite1979's machine is exhibiting this issue currently. @klabarge can you take a look?

image

@tresf
Copy link
Contributor Author

tresf commented Mar 22, 2020

Found another one today...

@tresf
Copy link
Contributor Author

tresf commented Mar 24, 2020

So the issue is that we properly detect that the desktop is NOT using Dark Mode (no value for SystemUsesLightTheme or AppsUseLightTheme) but the task bar is dark, which means we're falling back to the correct theme for the desktop, but the wrong theme for the icon. Unfortunately, different versions of Windows seem to ship with different defaults, so any assumptions may end up bring wrong.

image

Interestingly enough, this computer is running 1909 and the above theme preferences are documented as anything older than 1903, so it appears some type of "keep the current theme" is happening on machines that were upgraded.

I have a theory on how to properly detect and fix this using JNA, but it won't be pretty. I'll work with @Vzor- to see if he's up for the task.

@tresf
Copy link
Contributor Author

tresf commented Mar 24, 2020

Asked on StackOverflow... https://stackoverflow.com/q/60837862/3196753

@tresf
Copy link
Contributor Author

tresf commented Apr 11, 2020

So I went back to the oldest Windows 10 install I could find (using Rufus) and it appears the window theme should fallback to light mode; the taskbar should fallback to dark mode.

This is a bit different from how we have it coded currently, so the code need to separate the two properties so that the ui elements (such as the About dialog) can utilize the desktop theme while the taskbar utilizes the task bar theme.

Experimenting with these registry value, I can confirm that even the task bar prefers them (it changes immediately when they're changed) so they're the right way to monitor this.

New code available in dark branch per 012c03f.

@tresf
Copy link
Contributor Author

tresf commented Apr 13, 2020

New feature in action. Note it handles the system tray and the window decorating separately.

tresf added a commit that referenced this issue Apr 13, 2020
Separates system tray and window theming logic on Windows.
Closes #597
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants