From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daphne Preston-Kendal Newsgroups: gmane.emacs.devel Subject: Re: Detecting changes between dark and light mode on Mac OS Date: Sun, 21 Mar 2021 12:01:26 +0100 Message-ID: <392A1CAC-D5E0-47C5-BDFF-61A8601961F1@nonceword.org> References: <345983B0-C75E-46FF-870C-5FBD3D7381B9@nonceword.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16394"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Alan Third Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Mar 21 12:02:54 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lNvrC-00049L-FW for ged-emacs-devel@m.gmane-mx.org; Sun, 21 Mar 2021 12:02:54 +0100 Original-Received: from localhost ([::1]:35088 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNvrB-00009E-H3 for ged-emacs-devel@m.gmane-mx.org; Sun, 21 Mar 2021 07:02:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNvpt-00087O-Jd for emacs-devel@gnu.org; Sun, 21 Mar 2021 07:01:33 -0400 Original-Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:58869) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNvpq-0006zL-Cv for emacs-devel@gnu.org; Sun, 21 Mar 2021 07:01:33 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id B3D5C1355; Sun, 21 Mar 2021 07:01:28 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 21 Mar 2021 07:01:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=V0psWqe/qXRZFHfa/ePglO7CQWDM64VPt5Z4mS0D2 ho=; b=niPUyEGSfKxfkZD1OzxsaHlcvgGKMXXG4SHMsxv5QQr8hdlbacm9/u/00 /2cILZ+O732ZodsndNrLHzrKlYIqIjkYwiGRI8tv0xgsZ7MhCqxGc9yw1B/9qYwE u1cN3KWY1KRVdcnqYk3YlMkgozbvT0ePdCx7LBHRLKnlm43W/fKWiYZFOiuEIRal OFM0IfxKt+At7M02XGHfQWXYSZo4U8nMBLN4rl2mgH17drk4fRNWNycgGvGR49+a LFMUF58jljf1LS6mKzrQFSOjuopg15/0clMGnHx+lGL3Nk4oZP7vtPl0tCvipTuK OlFIYMt/+kGcGxWaZPBdssePjJEqw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudegvddgvddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurheptggguffhjgffgffkfhfvofesthhqmhdthhdtjeenucfhrhhomhepffgrphhh nhgvucfrrhgvshhtohhnqdfmvghnuggrlhcuoeguphhksehnohhntggvfihorhgurdhorh hgqeenucggtffrrghtthgvrhhnpeejjeeljeevgfeihfetieejieeugeeffeevkeehgeel keejkefhvdeuheegieegtdenucfkphepleehrdeltddrvdefgedrudefleenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpeguphhksehnohhntggv fihorhgurdhorhhg X-ME-Proxy: Original-Received: from [192.168.0.3] (unknown [95.90.234.139]) by mail.messagingengine.com (Postfix) with ESMTPA id 547A6240408; Sun, 21 Mar 2021 07:01:27 -0400 (EDT) In-Reply-To: X-Mailer: Apple Mail (2.3654.60.0.2.21) Received-SPF: none client-ip=64.147.123.20; envelope-from=dpk@nonceword.org; helo=wout4-smtp.messagingengine.com X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:266697 Archived-At: On 20 Mar 2021, at 18:52, Alan Third 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=E2=80=99t bother fixing) a very similar bug = with the selection colour while writing this patch: it gets set once when Emacs starts, but doesn=E2=80=99t get updated when the system theme changes. = So if you started Emacs when the system was in dark mode, then change to light, you=E2=80=99ll be stuck with the dark mode selection colour, etc. = (A day or two later I noticed that Apple=E2=80=99s own Mail app has the = exact same bug with the selection colour borders for messages in a thread.) Perhaps there=E2=80=99s 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? >=20 > 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. > --=20 > Alan Third Daphne Preston-Kendal