Automatically switch light / dark mode with Windows OS light / dark mode theme
Hi, since the end of 2024, WinMerge has been starting to get a dark mode (by choosing Theme=Midnight), which is great.
The issue is that WinMerge's light/dark mode is fixed: it does not automatically switch according to Windows' light/dark mode, like most applications do nowadays. Is there a way to make it switch automatically?
Regards
Unfortunately, WinMerge does not currently have the ability to automatically switch themes based on the Windows Light/Dark theme.
This is a dupe of #396? Close?
This is a dupe of #396? Close?
This issue is a bit different from issue #396 because it is a request for a feature to automatically switch to Dark/Light theme according to Windows settings.
I confirm it is very different from #396 ! The objective is to automate the Light/Dark mode switch in WinMerge according to Windows OS Light/Dark mode. Every application does that nowadays. Also, this should take just a few minutes to implement! (it is not like implementing a dark mode, here the topic is just the SWITCH feature)
OK, I expected the mode switch feature would include options System / Light / Dark - where System follows whatever Windows is using, which is de facto standard.
Every application does that nowadays.
Not every, only some "modern" ones and mainly they are usually non-"win32" such as Qt based or .NET Core.
Also, this should take just a few minutes to implement! (it is not like implementing a dark mode, here the topic is just the SWITCH feature)
Removing an appendix is relatively easy, you just need to cut it out. The harder part is ensuring that the patient remains alive and free of health complications.
When implementing a feature, even if the logic seems straightforward, there may be edge cases where it doesn’t work as expected. WinMerge supports operating systems from Windows XP onward, but how will it behave on older systems when settings are copied from a newer OS? What scheme should it default to? How do we check if an OS is using dark mode when there is no documented API? Does it even support dark mode? If a user changes modes while the app is running, should WinMerge adapt immediately or maintain the previous mode until a restart? Which color scheme is considered dark and which is light? Should we implement automatic detection or leave the choice to users?
I am working on #396 but with lack of time and feedback it will take some time, after #396 is implemented, implementing switching should be much simpler.
Take a note that even if #396 is implemented it might not work on newer OS, since currently to implement dark mode for win32 apps is to use undocumented API, which MS can remove anytime.
Removing an appendix is relatively easy, you just need to cut it out. The harder part is ensuring that the patient remains alive and free of health complications.
I agree with this consideration in general. Here, due to the nature of this feature, it is possible to add it without worrying about the edge cases: add it to the list without setting it as the default (I am saying this because in 2025, most Windows applications will have it as the default) and specify in brackets that it is beta. This will ensure people are aware of what they get, and user feedback can help improve it in the long run.
PR for #396 is almost ready, but I still need to do some test. Also I am still not getting feedback on it so it is slow process. After PR is merged implementing color scheme according to system could be done.
PR for #396 is almost ready, but I still need to do some test. Also I am still not getting feedback on it so it is slow process. After PR is merged implementing color scheme according to system could be done.
Thank you for working on dark mode support. I noticed your source code is under the GPLv3 license. I'm not very familiar with licensing, but since WinMerge is GPLv2, I'm concerned there might be a conflict. Would it be possible to use GPLv2 or another compatible license like MIT?
@sdottaka unfortunately dark mode code is based on Notepad++ code which is GPLv3, although very large of it is written by me, there are still parts written by others.
I looked quickly through winmerge code and it is already using GPLv3 component
Also winmerge itself seems to be GPLv2 and later, based on some header files, so if possible winmerge could be upgraded to GPLv3 and later license
patch.exe is GPLv3, but since it's only called as an external process, we believe it's not an issue. WinMerge is licensed under GPLv2 or later, so upgrading to GPLv3 might be possible... We'll consider it.
This feature request has been implemented in PR #2885.
In the Options window → Color schemes, setting Color mode to Follow system makes WinMerge follow the Windows setting.