Page MenuHome GnuPG

Kleopatra: Dark mode detection problems on Windows 10 2016
Closed, ResolvedPublic

Description

The current status is that with 3.2.0 we fixed several issues around high contrast / dark mode detection to make this work in general.

With Windows Enterprise LTSB 2016 we had the original issue that some required API was not available there. But we fixed this and now everything worked, but apparently only on Windows 10 > 17763


On 2016 though we have the problem that apparently some theme elements are not correctly loaded. This causes Kleopatra to look broken:

While the icons are chosen correctly to be the white icons, the issue seems to be that there are version guards checking for Windows 17763 in some places, as, according to documentation the dark mode for applications was introduced with that version.
But to add to the fun (and probably to save the trees!) dark mode support is included in the LTS version of Windows 2016 (lets call it that to be a bit less confusing).

With Qt6 the issue on this Windows version was the same, but could be fixed by adding --platformtheme windowsvista to the command line of Kleopatra.


Here the problem is that the icons are chosen wrongly. But on a recent Windows everything works correctly.

My conclusion is that since Windows 10 2016 does not have full support for Dark Mode Applications and only for High Contrast applications that we disable the check for dark mode based on personalization from this.
Not instantiating KColorSchemeManager should do the trick. And only leave the High Contrast detection, which has been working and which also works in the current GnuPG VS-Desktop / Gpg4win versions.

Since Windows 2016 is still important as a platform for us and the dark mode Kleopatra is unusable there this is somewhat urgent.

Related Objects

Event Timeline

aheinecke created this task.

I got confused in the various tests and mixed up the Qt6 test on normal Windows 10 with the Qt5 test. In the Qt6 case there are still issues, but that might be explained by packaging still. But for this we have less urgency.

With the fixes a build from Gpg4win master (kf5) should now no longer switch the colors or the icons when in dark mode. This should only be done in high contrast mode. I am adding screenshots from the tests here so I also don't get confused between the different versions:

Tests on LTSB in dark mode:


High contrast black:

High contrast white:

On Windows 10 19045 dark mode:


High contrast black:

And high contrast white:

This was solved by modifying our Icon loading patch and adding a patch not to activate the theme if the version is < Windows10 17763

17763 Is the version Qt uses in their version check.

As shown in the above screenshots the fix was tested by me.

werner mentioned this in Unknown Object (Maniphest Task).Aug 28 2024, 11:51 AM
ebo edited projects, added vsd32 (vsd-3.2.3); removed vsd32.