mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
win32: follow Windows settings and update dark mode state
Microsoft documented how to enable dark mode for title bar: https://learn.microsoft.com/windows/apps/desktop/modernize/apply-windows-themes https://learn.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute Documentation says to set the DWMWA_USE_IMMERSIVE_DARK_MODE attribute to TRUE to honor dark mode for the window, FALSE to always use light mode. While in fact setting it to TRUE causes dark mode to be always enabled, regardless of the settings. Since it is quite unlikely that it will be fixed, just use UxTheme API to check if dark mode should be applied and while at it enable it fully. Ideally this function should only call the DwmSetWindowAttribute(), but it just doesn't work as documented. Fixes: #6901
This commit is contained in:
@@ -477,6 +477,7 @@ if features['win32-desktop']
|
||||
cc.find_library('gdi32'),
|
||||
cc.find_library('ole32'),
|
||||
cc.find_library('uuid'),
|
||||
cc.find_library('uxtheme'),
|
||||
cc.find_library('version'),
|
||||
cc.find_library('winmm')]
|
||||
dependencies += win32_desktop_libs
|
||||
|
||||
Reference in New Issue
Block a user