summaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-03-19 06:40:53 +0100
committersfan5 <sfan5@live.de>2023-04-04 20:04:57 +0200
commit9feeb324eddd9ed73ae667e10275f663d70f7544 (patch)
tree89175184ae18aea506bf91a98f49b54da097b963 /wscript
parent68b3239b523cd75ba0a12f680ac7bc77e5647d40 (diff)
downloadmpv-9feeb324eddd9ed73ae667e10275f663d70f7544.tar.bz2
mpv-9feeb324eddd9ed73ae667e10275f663d70f7544.tar.xz
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
Diffstat (limited to 'wscript')
-rw-r--r--wscript9
1 files changed, 8 insertions, 1 deletions
diff --git a/wscript b/wscript
index d660404594..2f97bb660a 100644
--- a/wscript
+++ b/wscript
@@ -201,7 +201,14 @@ main_dependencies = [
'name': 'win32-desktop',
'desc': 'win32 desktop APIs',
'deps': '(os-win32 || os-cygwin) && !uwp',
- 'func': check_cc(lib=['winmm', 'gdi32', 'ole32', 'uuid', 'avrt', 'dwmapi', 'version']),
+ 'func': check_cc(lib=['avrt',
+ 'dwmapi',
+ 'gdi32',
+ 'ole32',
+ 'uuid',
+ 'uxtheme',
+ 'version',
+ 'winmm']),
}, {
'name': '--win32-internal-pthreads',
'desc': 'internal pthread wrapper for win32 (Vista+)',