unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Daphne Preston-Kendal <dpk@nonceword.org>
To: Alan Third <alan@idiocy.org>
Cc: emacs-devel@gnu.org
Subject: Re: Detecting changes between dark and light mode on Mac OS
Date: Sun, 21 Mar 2021 12:01:26 +0100	[thread overview]
Message-ID: <392A1CAC-D5E0-47C5-BDFF-61A8601961F1@nonceword.org> (raw)
In-Reply-To: <YFY2dZ4HbqXmFoTe@breton.holly.idiocy.org>

On 20 Mar 2021, at 18:52, Alan Third <alan@idiocy.org> wrote:

> I'm not sure about this patch purely on the grounds that the scrollbar
> colour Just Works with the Emacs theme in the current set up, but when
> you explicitly set light or dark it has to explicitly match the theme
> or it looks very strange. Even then the background is the wrong colour
> in themes that don't use white or black.

Hmm, I noticed (but didn’t bother fixing) a very similar bug with the
selection colour while writing this patch: it gets set once when Emacs
starts, but doesn’t get updated when the system theme changes. So if
you started Emacs when the system was in dark mode, then change to
light, you’ll be stuck with the dark mode selection colour, etc. (A
day or two later I noticed that Apple’s own Mail app has the exact
same bug with the selection colour borders for messages in a thread.)

Perhaps there’s a bunch of different colour/theme related appearance
changes that need to be automagically made when Emacs receives the
AppleInterfaceThemeChangedNotification event.

> Is that down to our choice of light and dark macOS themes? Perhaps
> there's a smarter way of setting the theme for various widgets?
> 
> Aside from that it looks OK to me. The only major changes I think I'd
> require are some #ifs to limit the new code to macOS 10.14+, but
> that's not a big problem.

Yes, good plan. I noticed that Emacs was using the
NSAppearanceNameVibrantDark before, which is presumably what the
menu-bar-only version of dark mode in Mac OSes 10.10 to 10.13 was
called? When I tested the effectiveAppearance against it, it always
thought *VibrantDark was light mode, so I used *DarkAqua in my patch.
Providing two versions, one for 10.10 to 10.13 with roughly the old
behaviour using *VibrantDark, and one for 10.14+ with the new
behaviour, seems like a decent plan.

> -- 
> Alan Third

Daphne Preston-Kendal




  reply	other threads:[~2021-03-21 11:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-09 13:23 Detecting changes between dark and light mode on Mac OS Daphne Preston-Kendal
2021-03-20 16:51 ` Daphne Preston-Kendal
2021-03-20 17:52   ` Alan Third
2021-03-21 11:01     ` Daphne Preston-Kendal [this message]
2021-03-21  7:01   ` Lars Ingebrigtsen
2021-03-21 10:22     ` Daphne Preston-Kendal
2021-03-22 20:07       ` Lars Ingebrigtsen
2021-03-23 18:32         ` chad
2021-03-23 17:49     ` Matt Armstrong
2021-03-24  8:30       ` Lars Ingebrigtsen
2021-03-25 16:33         ` Stefan Monnier
2021-03-28  1:16           ` chad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=392A1CAC-D5E0-47C5-BDFF-61A8601961F1@nonceword.org \
    --to=dpk@nonceword.org \
    --cc=alan@idiocy.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).