GNU bug report logs - #68766
29.2; Windows dark/light mode changes does not reflect on Emacs Title bar/Scrollbar

Previous Next

Package: emacs;

Reported by: "Rahul M. Juliato" <rahuljuliato <at> gmail.com>

Date: Sun, 28 Jan 2024 02:10:02 UTC

Severity: normal

Found in version 29.2

Full log


Message #11 received at 68766 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Rahul M. Juliato" <rahuljuliato <at> gmail.com>
Cc: 68766 <at> debbugs.gnu.org
Subject: Re: bug#68766: 29.2;
 Windows dark/light mode changes does not reflect on Emacs Title
 bar/Scrollbar
Date: Sun, 28 Jan 2024 08:38:20 +0200
> From: "Rahul M. Juliato" <rahuljuliato <at> gmail.com>
> Date: Sat, 27 Jan 2024 23:08:45 -0300
> 
> It seems Emacs only sets it's title bar and scrollbar colors during
> initialization, not during run time.

More accurately, the dark/light theme is examined and affected when
Emacs creates a frame.  So in the scenario you described, any frames
created _after_ running the script should obey the new dark/light
setting, but the frames which existed at the time of the change will
retain their appearance.

> I do not know if this is "by design" or "a bug", hence my bug-report.

It's "by design", in the sense that this is how the Dark theme support
is implemented in Emacs.  If someone submits changes to react to theme
change immediately for all the frames, we can consider that for
inclusion.

> I'd also like to mention that ~auto-dark~ has a hook after changing to
> both light/dark modes that could be used to run some extra elisp code if
> needed.
> 
> Is it possible to change the system title bar/scrollbar colors or "theme"
> from inside Emacs with Elisp?

No, it is not currently possible.  The code which determines the
dark/light mode of a frame runs at frame creation time, so exposing it
to Lisp would not be useful.  The development version (what will be
Emacs 30 in due time) has a user option to opt out of following the
system-wide Dark mode, but that option is only useful if set in the
init file.




This bug report was last modified 1 year and 173 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.