mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-12-16 22:23:07 +00:00
Add workaround for DWM dark mode bug on Win10
This commit is contained in:
parent
e45b6b9b85
commit
5b7c144796
1 changed files with 7 additions and 0 deletions
|
@ -1463,6 +1463,13 @@ void Session::execInternal()
|
|||
if (FAILED(DwmSetWindowAttribute(info.info.win.window, DWMWA_USE_IMMERSIVE_DARK_MODE, &darkModeEnabled, sizeof(darkModeEnabled)))) {
|
||||
DwmSetWindowAttribute(info.info.win.window, DWMWA_USE_IMMERSIVE_DARK_MODE_OLD, &darkModeEnabled, sizeof(darkModeEnabled));
|
||||
}
|
||||
|
||||
// Toggle non-client rendering off and back on to ensure dark mode takes effect on Windows 10.
|
||||
// DWM doesn't seem to correctly invalidate the non-client area after enabling dark mode.
|
||||
DWMNCRENDERINGPOLICY ncPolicy = DWMNCRP_DISABLED;
|
||||
DwmSetWindowAttribute(info.info.win.window, DWMWA_NCRENDERING_POLICY, &ncPolicy, sizeof(ncPolicy));
|
||||
ncPolicy = DWMNCRP_ENABLED;
|
||||
DwmSetWindowAttribute(info.info.win.window, DWMWA_NCRENDERING_POLICY, &ncPolicy, sizeof(ncPolicy));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue