-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows Dark Theme Support #6901
Comments
Just to add, I think the title bar should be black if you have dark theme turned on and a compliant program while also not explicitly telling windows to use your accent colour on it. We can see this behaviour on a few Win32 things, like the file explorer and powershell. I don't believe this should be a lot of work but I'm also not entirely sure it's properly documented. It might be part of XAML Islands. I think the browsers can also switch between their themes whenever you change the global windows setting, but they're drawing their own decorations. |
I thought it might be a window style but it ain't. It's likely win32 non client area custom paint or there is a function that can set it. |
It was asked at stack overflow without anybody knowing the answer. https://stackoverflow.com/questions/57124243/winforms-dark-title-bar-on-windows-10 |
Here's something interesting in microsoft/terminal: It seems like Microsoft are using internal undocumented APIs (as usual) to enable these features for their first-party software. I wrote a test program to call these two functions, and it seems to work: This only works in the release version of Windows 10 though. In the insiders build, it seems like these APIs are no longer enough to enable dark mode. Dark mode doesn't work for the console in the insiders build either, but it still works for Explorer. I'd like to enable dark mode for mpv, but not while it's an internal API that changes between each release of Windows 10. (Especially not while it requires that call-by-ordinal ShouldAppsUseDarkMode API to check if dark mode is enabled or not.) Hopefully they add a public API, or at least a stable undocumented API, to the next Windows 10 release. |
I've been trying out similar at rust-windowing/winit#1217 . I'm also on insiders. After a little experimentation I found that the Accordingly, I'm considering using a build version check to switch between |
Was this on insider's? @davidhewitt |
In the end I went for the approach showcased in this repository, which works for most Windows 10 versions from 2018 and up: https://github.com/ysc3839/win32-darkmode (Insiders and stable) |
Hey that's perfect, that could work here too |
Hey there, is there any movement on this? mpv is the best and the player of my choice, the only problem is the white titlebar when all Windows is in the dark mode. |
…stem setting This is now documented way to allow dark mode window frame appearance: https://learn.microsoft.com/windows/apps/desktop/modernize/apply-windows-themes https://learn.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute I'm not interested in various undocumented APIs to make context menu dark and so on. Documentation says this DWM attribute is supported starting with Windows 11 Build 22000. It seems to work well on Windows 10... while in fact doesn't work on Windows 11, at lest on my system. Feel free to report it to Microsoft and ping me when they release proper API for that. Until then this small improvment is a step the right direction. Fixes: mpv-player#6901
…stem setting This is now documented way to allow dark mode window frame appearance: https://learn.microsoft.com/windows/apps/desktop/modernize/apply-windows-themes https://learn.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute I'm not interested in various undocumented APIs to make context menu dark and so on. Documentation says this DWM attribute is supported starting with Windows 11 Build 22000. It seems to work well on Windows 10... while in fact doesn't work on Windows 11, at least on my system. Feel free to report it to Microsoft and ping me when they release proper API for that. Until then this small improvement is a step the right direction. Fixes: mpv-player#6901
…stem setting This is now documented way to allow dark mode window frame appearance: https://learn.microsoft.com/windows/apps/desktop/modernize/apply-windows-themes https://learn.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute I'm not interested in various undocumented APIs to make context menu dark and so on. Documentation says this DWM attribute is supported starting with Windows 11 Build 22000. It seems to work well on Windows 10... while in fact doesn't work on Windows 11, at least on my system. Feel free to report it to Microsoft and ping me when they release proper API for that. Until then this small improvement is a step in the right direction. Fixes: mpv-player#6901
…stem setting This is now documented way to allow dark mode window frame appearance: https://learn.microsoft.com/windows/apps/desktop/modernize/apply-windows-themes https://learn.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute I'm not interested in various undocumented APIs to make context menu dark and so on. Documentation says this DWM attribute is supported starting with Windows 11 Build 22000. It seems to work well on Windows 10... while in fact doesn't work on Windows 11, at least on my system. Feel free to report it to Microsoft and ping me when they release proper API for that. Until then this small improvement is a step in the right direction. Fixes: mpv-player#6901
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: mpv-player#6901
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: mpv-player#6901
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: mpv-player#6901
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: mpv-player#6901
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: mpv-player#6901
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
Yay! Thank you! Everything is great now! |
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: mpv-player#6901
Hi, this is when window is active:
This is when it's inactive:
Top bar of the File Explorer is dark when window is inactive.
But with MPV, it's white when window is inactive(not focused).
Could you please add support for this.
The text was updated successfully, but these errors were encountered: