diff options
author | Eli Zaretskii <eliz@gnu.org> | 2024-01-27 19:11:22 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2024-01-27 19:11:22 +0200 |
commit | 58f0603d40d238383aaa911eb09b3e2809177bfa (patch) | |
tree | c3edd679a5f8d9c6f9bcf98093097d7fa13b3e09 /src/w32fns.c | |
parent | 3c4b6823c3f92291888a24b7fee40de82bb92d68 (diff) | |
download | emacs-58f0603d40d238383aaa911eb09b3e2809177bfa.tar.gz |
Allow users to opt out of following Windows Dark mode
* src/w32fns.c (globals_of_w32fns) <w32-follow-system-dark-mode>:
New variable.
(w32_applytheme): Disable application of Dark mode if
'w32-follow-system-dark-mode' is nil.
* etc/NEWS:
* doc/emacs/msdos.texi (Windows Misc): Document
'w32-follow-system-dark-mode'.
Diffstat (limited to 'src/w32fns.c')
-rw-r--r-- | src/w32fns.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index f44460e52c0..8d4bd00b91c 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -2376,7 +2376,7 @@ w32_init_class (HINSTANCE hinst) static void w32_applytheme (HWND hwnd) { - if (w32_darkmode) + if (w32_darkmode && w32_follow_system_dark_mode) { /* Set window theme to that of a built-in Windows app (Explorer), because it has dark scroll bars and other UI elements. */ @@ -11393,6 +11393,14 @@ This variable is used for debugging, and takes precedence over any value of the `inhibit-double-buffering' frame parameter. */); w32_disable_double_buffering = false; + DEFVAR_BOOL ("w32-follow-system-dark-mode", w32_follow_system_dark_mode, + doc: /* Whether to follow the system's Dark mode on MS-Windows. +If this is nil, Emacs on MS-Windows will not follow the system's Dark +mode as far as the appearance of title bars and scroll bars is +concerned, it will always use the default Light mode instead. +Changing the value takes effect only for frames created after the change. */); + w32_follow_system_dark_mode = true; + if (os_subtype == OS_SUBTYPE_NT) w32_unicode_gui = 1; else |