Code here needs to be modified for Windows 10 1903+:
|
if (!(hc.dwFlags & HCF_HIGHCONTRASTON) && pShouldAppsUseDarkMode()) { |
ShouldAppsUseDarkMode should be replaced by ShouldSystemUseDarkMode at ordinal 138, according to issue here. I've confirmed that.
Also, this constant should be alerted:
|
#define DWMWA_USE_IMMERSIVE_DARK_MODE 19 |
According to pull request here, (I had decompiled the dll provided by the DWM team, and found that) DWMWA_USE_IMMERSIVE_DARK_MODE maybe 20 on newer systems, and we should try to set both(19 and 20) to TRUE to ensure. As for the order, the DWM team choose to try 20 at first.
Also, for dark title bar and menus, we should call function at ordinal 135(AllowDarkModeForApp(TRUE) in 1809 or SetPreferredAppMode(AllowDark) in 1903) and FlushMenuThemes() at ordinal 136. The declaration of these functions could be found here.
Code here needs to be modified for Windows 10 1903+:
mintty/src/winmain.c
Line 4943 in ee2edc8
ShouldAppsUseDarkModeshould be replaced byShouldSystemUseDarkModeat ordinal 138, according to issue here. I've confirmed that.Also, this constant should be alerted:
mintty/src/winmain.c
Line 4948 in ee2edc8
According to pull request here, (I had decompiled the dll provided by the DWM team, and found that)
DWMWA_USE_IMMERSIVE_DARK_MODEmaybe20on newer systems, and we should try to set both(19and20) toTRUEto ensure. As for the order, the DWM team choose to try20at first.Also, for dark title bar and menus, we should call function at ordinal 135(
AllowDarkModeForApp(TRUE)in 1809 orSetPreferredAppMode(AllowDark)in 1903) andFlushMenuThemes()at ordinal 136. The declaration of these functions could be found here.