unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#33452: Color of tooltip text on macOS with mark mode
@ 2018-11-21  7:30 Tak Kunihiro
  2018-11-21  9:30 ` Eli Zaretskii
  0 siblings, 1 reply; 14+ messages in thread
From: Tak Kunihiro @ 2018-11-21  7:30 UTC (permalink / raw)
  To: 33452

When Emacs 26.1.90 is launched on macOS with dark mode, color of
tooltip text is set to white. It is hard to read the text.

 Switch to dark-mode on macOS
 $ cd ~/emacs-26.1.90/
 $ ./configure; make install
 $ ~/emacs-26.1.90/nextstep/Emacs.app/Contents/MacOS/Emacs -Q
 M-: (setq mouse-drag-and-drop-region 'meta)

During dragging region, tooltip shows text in the region.  Color of
tooltip background is yellow, and color of tooltip text is white.

I think that color of either tooltip text or tooltip background should
be darker.





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#33452: Color of tooltip text on macOS with mark mode
  2018-11-21  7:30 bug#33452: Color of tooltip text on macOS with mark mode Tak Kunihiro
@ 2018-11-21  9:30 ` Eli Zaretskii
  2018-11-21 10:14   ` bug#33452: Color of tooltip text on macOS with dark mode Tak Kunihiro
  0 siblings, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2018-11-21  9:30 UTC (permalink / raw)
  To: Tak Kunihiro; +Cc: 33452

> Date: Wed, 21 Nov 2018 16:30:56 +0900 (JST)
> From: Tak Kunihiro <tkk@misasa.okayama-u.ac.jp>
> 
> When Emacs 26.1.90 is launched on macOS with dark mode, color of
> tooltip text is set to white. It is hard to read the text.

Is this problem new with Emacs 26.1.90?

Thanks.





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#33452: Color of tooltip text on macOS with dark mode
  2018-11-21  9:30 ` Eli Zaretskii
@ 2018-11-21 10:14   ` Tak Kunihiro
  2018-11-21 10:32     ` Eli Zaretskii
  0 siblings, 1 reply; 14+ messages in thread
From: Tak Kunihiro @ 2018-11-21 10:14 UTC (permalink / raw)
  To: eliz; +Cc: tkk, 33452

>> When Emacs 26.1.90 is launched on macOS with dark mode, color of
>> tooltip text is set to white. It is hard to read the text.
> 
> Is this problem new with Emacs 26.1.90?

I do not see the problem in 27.0.50.





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#33452: Color of tooltip text on macOS with dark mode
  2018-11-21 10:14   ` bug#33452: Color of tooltip text on macOS with dark mode Tak Kunihiro
@ 2018-11-21 10:32     ` Eli Zaretskii
  2018-11-21 19:44       ` Alan Third
  0 siblings, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2018-11-21 10:32 UTC (permalink / raw)
  To: Tak Kunihiro; +Cc: 33452

> Date: Wed, 21 Nov 2018 19:14:35 +0900 (JST)
> Cc: 33452@debbugs.gnu.org, tkk@misasa.okayama-u.ac.jp
> From: Tak Kunihiro <tkk@misasa.okayama-u.ac.jp>
> 
> >> When Emacs 26.1.90 is launched on macOS with dark mode, color of
> >> tooltip text is set to white. It is hard to read the text.
> > 
> > Is this problem new with Emacs 26.1.90?
> 
> I do not see the problem in 27.0.50.

Can you test with Emacs 26.1?

In any case, it sounds like the problem, whatever it is, was solved on
master.





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#33452: Color of tooltip text on macOS with dark mode
  2018-11-21 10:32     ` Eli Zaretskii
@ 2018-11-21 19:44       ` Alan Third
  2018-11-22 12:44         ` Tak Kunihiro
  2018-11-23 10:29         ` Eli Zaretskii
  0 siblings, 2 replies; 14+ messages in thread
From: Alan Third @ 2018-11-21 19:44 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Tak Kunihiro, 33452

On Wed, Nov 21, 2018 at 12:32:10PM +0200, Eli Zaretskii wrote:
> > Date: Wed, 21 Nov 2018 19:14:35 +0900 (JST)
> > Cc: 33452@debbugs.gnu.org, tkk@misasa.okayama-u.ac.jp
> > From: Tak Kunihiro <tkk@misasa.okayama-u.ac.jp>
> > 
> > >> When Emacs 26.1.90 is launched on macOS with dark mode, color of
> > >> tooltip text is set to white. It is hard to read the text.
> > > 
> > > Is this problem new with Emacs 26.1.90?
> > 
> > I do not see the problem in 27.0.50.
> 
> Can you test with Emacs 26.1?
> 
> In any case, it sounds like the problem, whatever it is, was solved on
> master.

I expect it was commit 15cd18991c1d9a9bafeef7bf9b4dad91ecc0332a.

It’s pretty small and is probably safe to backport to emacs-26.
-- 
Alan Third





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#33452: Color of tooltip text on macOS with dark mode
  2018-11-21 19:44       ` Alan Third
@ 2018-11-22 12:44         ` Tak Kunihiro
  2018-11-23 10:29         ` Eli Zaretskii
  1 sibling, 0 replies; 14+ messages in thread
From: Tak Kunihiro @ 2018-11-22 12:44 UTC (permalink / raw)
  To: alan; +Cc: tkk, 33452

>>>>> When Emacs 26.1.90 is launched on macOS with dark mode, color of
>>>>> tooltip text is set to white. It is hard to read the text.
>>>> 
>>>> Is this problem new with Emacs 26.1.90?
>>> 
>>> I do not see the problem in 27.0.50.
>> 
>> Can you test with Emacs 26.1?

Emacs 26.1 build on macOS Mojave (10.14) cannot show text even on
scratch buffer.  I cannot test Emacs 26.1 build under macOS Mojave
(10.14).

>> In any case, it sounds like the problem, whatever it is, was solved on
>> master.
> 
> I expect it was commit 15cd18991c1d9a9bafeef7bf9b4dad91ecc0332a.n
> 
> It’s pretty small and is probably safe to backport to emacs-26.

I applied the commit 15cd18991c1d9a9bafeef7bf9b4dad91ecc0332a to
26.1.90 and confirmed that I do not see the problem.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#33452: Color of tooltip text on macOS with dark mode
  2018-11-21 19:44       ` Alan Third
  2018-11-22 12:44         ` Tak Kunihiro
@ 2018-11-23 10:29         ` Eli Zaretskii
  2018-11-23 18:10           ` Alan Third
  1 sibling, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2018-11-23 10:29 UTC (permalink / raw)
  To: Alan Third; +Cc: tkk, 33452

> Date: Wed, 21 Nov 2018 19:44:58 +0000
> From: Alan Third <alan@idiocy.org>
> Cc: Tak Kunihiro <tkk@misasa.okayama-u.ac.jp>, 33452@debbugs.gnu.org
> 
> I expect it was commit 15cd18991c1d9a9bafeef7bf9b4dad91ecc0332a.

Are you saying that tooltips on NS couldn't use colors before that
change?  Or was that color support broken at some point?  If the
latter, when was it broken and by what changeset?

Thanks.





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#33452: Color of tooltip text on macOS with dark mode
  2018-11-23 10:29         ` Eli Zaretskii
@ 2018-11-23 18:10           ` Alan Third
  2018-11-23 20:13             ` Eli Zaretskii
  0 siblings, 1 reply; 14+ messages in thread
From: Alan Third @ 2018-11-23 18:10 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: tkk, 33452

On Fri, Nov 23, 2018 at 12:29:53PM +0200, Eli Zaretskii wrote:
> > Date: Wed, 21 Nov 2018 19:44:58 +0000
> > From: Alan Third <alan@idiocy.org>
> > Cc: Tak Kunihiro <tkk@misasa.okayama-u.ac.jp>, 33452@debbugs.gnu.org
> > 
> > I expect it was commit 15cd18991c1d9a9bafeef7bf9b4dad91ecc0332a.
> 
> Are you saying that tooltips on NS couldn't use colors before that
> change?  Or was that color support broken at some point?  If the
> latter, when was it broken and by what changeset?

Tooltips on NS couldn’t use colours before that change.

What happened is that tooltips set the background to yellow and left
the foreground (text) to be the system default (black).

MacOS Mojave has introduced ‘dark mode’, which makes the foreground
colour light, and therefore we’re seeing light text on a yellow
background.

If you don’t want to apply the above commit the absolute minimum fix
for emacs-26 would be to explicitly set a foreground colour for
tooltips, or not set the background, therefore reverting to the system
default.

-- 
Alan Third





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#33452: Color of tooltip text on macOS with dark mode
  2018-11-23 18:10           ` Alan Third
@ 2018-11-23 20:13             ` Eli Zaretskii
  2018-11-23 20:38               ` Alan Third
  0 siblings, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2018-11-23 20:13 UTC (permalink / raw)
  To: Alan Third; +Cc: tkk, 33452

> Date: Fri, 23 Nov 2018 18:10:49 +0000
> From: Alan Third <alan@idiocy.org>
> Cc: tkk@misasa.okayama-u.ac.jp, 33452@debbugs.gnu.org
> 
> > Are you saying that tooltips on NS couldn't use colors before that
> > change?  Or was that color support broken at some point?  If the
> > latter, when was it broken and by what changeset?
> 
> Tooltips on NS couldn’t use colours before that change.
> 
> What happened is that tooltips set the background to yellow and left
> the foreground (text) to be the system default (black).
> 
> MacOS Mojave has introduced ‘dark mode’, which makes the foreground
> colour light, and therefore we’re seeing light text on a yellow
> background.
> 
> If you don’t want to apply the above commit the absolute minimum fix
> for emacs-26 would be to explicitly set a foreground colour for
> tooltips, or not set the background, therefore reverting to the system
> default.

Sorry, I'm confused: does "system default" mean the tooltips will be
without colors, or does it mean they will use the system colors?  If
the latter, then why did you say in the beginning that "tooltips on NS
couldn't use colors"?





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#33452: Color of tooltip text on macOS with dark mode
  2018-11-23 20:13             ` Eli Zaretskii
@ 2018-11-23 20:38               ` Alan Third
  2018-11-23 21:08                 ` Eli Zaretskii
  0 siblings, 1 reply; 14+ messages in thread
From: Alan Third @ 2018-11-23 20:38 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: tkk, 33452

On Fri, Nov 23, 2018 at 10:13:40PM +0200, Eli Zaretskii wrote:
> > Date: Fri, 23 Nov 2018 18:10:49 +0000
> > From: Alan Third <alan@idiocy.org>
> > Cc: tkk@misasa.okayama-u.ac.jp, 33452@debbugs.gnu.org
> > 
> > > Are you saying that tooltips on NS couldn't use colors before that
> > > change?  Or was that color support broken at some point?  If the
> > > latter, when was it broken and by what changeset?
> > 
> > Tooltips on NS couldn’t use colours before that change.
> > 
> > What happened is that tooltips set the background to yellow and left
> > the foreground (text) to be the system default (black).
> > 
> > MacOS Mojave has introduced ‘dark mode’, which makes the foreground
> > colour light, and therefore we’re seeing light text on a yellow
> > background.
> > 
> > If you don’t want to apply the above commit the absolute minimum fix
> > for emacs-26 would be to explicitly set a foreground colour for
> > tooltips, or not set the background, therefore reverting to the system
> > default.
> 
> Sorry, I'm confused: does "system default" mean the tooltips will be
> without colors, or does it mean they will use the system colors?  If
> the latter, then why did you say in the beginning that "tooltips on NS
> couldn't use colors"?

Sorry, I thought you were meaning colours as set by Emacs lisp.

We can set the foreground and background to anything we want in C, but
in emacs-26 currently we can’t modify them by Emacs lisp, and only the
background colour is being set in C, which leaves the foreground to
use whatever the system default is.

The master branch honours the colours set by lisp.

A little more background, which hopefully won’t confuse things more:

NS tooltips are very basic, whoever wrote the tooltips for Emacs under
NS decided to use a full toolkit window instead, and just colour it
like the default Emacs tooltips on X. Except they only did half the
job, which wasn’t a problem until Apple decided to change the default
colours.
-- 
Alan Third





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#33452: Color of tooltip text on macOS with dark mode
  2018-11-23 20:38               ` Alan Third
@ 2018-11-23 21:08                 ` Eli Zaretskii
  2018-11-24  9:35                   ` Alan Third
  0 siblings, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2018-11-23 21:08 UTC (permalink / raw)
  To: Alan Third; +Cc: tkk, 33452

> Date: Fri, 23 Nov 2018 20:38:51 +0000
> From: Alan Third <alan@idiocy.org>
> Cc: tkk@misasa.okayama-u.ac.jp, 33452@debbugs.gnu.org
> 
> Sorry, I thought you were meaning colours as set by Emacs lisp.
> 
> We can set the foreground and background to anything we want in C, but
> in emacs-26 currently we can’t modify them by Emacs lisp, and only the
> background colour is being set in C, which leaves the foreground to
> use whatever the system default is.
> 
> The master branch honours the colours set by lisp.

Thanks.  So what are out alternatives for emacs-26, besides
backporting from master (which will give control on colors to Lisp)?





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#33452: Color of tooltip text on macOS with dark mode
  2018-11-23 21:08                 ` Eli Zaretskii
@ 2018-11-24  9:35                   ` Alan Third
  2018-11-24  9:44                     ` Eli Zaretskii
  2018-11-25 11:36                     ` Alan Third
  0 siblings, 2 replies; 14+ messages in thread
From: Alan Third @ 2018-11-24  9:35 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: tkk, 33452

[-- Attachment #1: Type: text/plain, Size: 883 bytes --]

On Fri, Nov 23, 2018 at 11:08:18PM +0200, Eli Zaretskii wrote:
> > Date: Fri, 23 Nov 2018 20:38:51 +0000
> > From: Alan Third <alan@idiocy.org>
> > Cc: tkk@misasa.okayama-u.ac.jp, 33452@debbugs.gnu.org
> > 
> > Sorry, I thought you were meaning colours as set by Emacs lisp.
> > 
> > We can set the foreground and background to anything we want in C, but
> > in emacs-26 currently we can’t modify them by Emacs lisp, and only the
> > background colour is being set in C, which leaves the foreground to
> > use whatever the system default is.
> > 
> > The master branch honours the colours set by lisp.
> 
> Thanks.  So what are out alternatives for emacs-26, besides
> backporting from master (which will give control on colors to Lisp)?

We can try to use the system tooltip colours, but I think we’re better
off just setting a foreground colour. Patch attached.
-- 
Alan Third

[-- Attachment #2: 0001-Set-tooltip-text-color-bug-33452.patch --]
[-- Type: text/plain, Size: 1555 bytes --]

From 1caacbf3600302ca3dd7da4371e30857c4b01f51 Mon Sep 17 00:00:00 2001
From: Alan Third <alan@idiocy.org>
Date: Sat, 24 Nov 2018 09:30:17 +0000
Subject: [PATCH] Set tooltip text color (bug#33452)

; Do not merge into master

* src/nsmenu.m: ([EmacsTooltip init]): Set text color to black.
---
 src/nsmenu.m | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/nsmenu.m b/src/nsmenu.m
index 604adcf40b..52a7d52e8e 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -1318,8 +1318,9 @@ @implementation EmacsTooltip
 
 - (instancetype)init
 {
-  NSColor *col = [NSColor colorWithCalibratedRed: 1.0 green: 1.0
+  NSColor *bgcol = [NSColor colorWithCalibratedRed: 1.0 green: 1.0
                                             blue: 0.792 alpha: 0.95];
+  NSColor *fgcol = [NSColor blackColor];
   NSFont *font = [NSFont toolTipsFontOfSize: 0];
   NSFont *sfont = [font screenFont];
   int height = [sfont ascender] - [sfont descender];
@@ -1328,7 +1329,8 @@ - (instancetype)init
 
   textField = [[NSTextField alloc] initWithFrame: r];
   [textField setFont: font];
-  [textField setBackgroundColor: col];
+  [textField setTextColor: fgcol];
+  [textField setBackgroundColor: bgcol];
 
   [textField setEditable: NO];
   [textField setSelectable: NO];
@@ -1345,7 +1347,7 @@ - (instancetype)init
   [win setReleasedWhenClosed: NO];
   [win setDelegate: self];
   [[win contentView] addSubview: textField];
-/*  [win setBackgroundColor: col]; */
+/*  [win setBackgroundColor: bgcol]; */
   [win setOpaque: NO];
 
   return self;
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* bug#33452: Color of tooltip text on macOS with dark mode
  2018-11-24  9:35                   ` Alan Third
@ 2018-11-24  9:44                     ` Eli Zaretskii
  2018-11-25 11:36                     ` Alan Third
  1 sibling, 0 replies; 14+ messages in thread
From: Eli Zaretskii @ 2018-11-24  9:44 UTC (permalink / raw)
  To: Alan Third; +Cc: tkk, 33452

> Date: Sat, 24 Nov 2018 09:35:25 +0000
> From: Alan Third <alan@idiocy.org>
> Cc: tkk@misasa.okayama-u.ac.jp, 33452@debbugs.gnu.org
> 
> We can try to use the system tooltip colours, but I think we’re better
> off just setting a foreground colour. Patch attached.

OK, thanks.





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#33452: Color of tooltip text on macOS with dark mode
  2018-11-24  9:35                   ` Alan Third
  2018-11-24  9:44                     ` Eli Zaretskii
@ 2018-11-25 11:36                     ` Alan Third
  1 sibling, 0 replies; 14+ messages in thread
From: Alan Third @ 2018-11-25 11:36 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: tkk, 33452-done

On Sat, Nov 24, 2018 at 09:35:25AM +0000, Alan Third wrote:
> On Fri, Nov 23, 2018 at 11:08:18PM +0200, Eli Zaretskii wrote:
> > Thanks.  So what are out alternatives for emacs-26, besides
> > backporting from master (which will give control on colors to Lisp)?
> 
> We can try to use the system tooltip colours, but I think we’re better
> off just setting a foreground colour. Patch attached.

Pushed to emacs-26.
-- 
Alan Third





^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2018-11-25 11:36 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-21  7:30 bug#33452: Color of tooltip text on macOS with mark mode Tak Kunihiro
2018-11-21  9:30 ` Eli Zaretskii
2018-11-21 10:14   ` bug#33452: Color of tooltip text on macOS with dark mode Tak Kunihiro
2018-11-21 10:32     ` Eli Zaretskii
2018-11-21 19:44       ` Alan Third
2018-11-22 12:44         ` Tak Kunihiro
2018-11-23 10:29         ` Eli Zaretskii
2018-11-23 18:10           ` Alan Third
2018-11-23 20:13             ` Eli Zaretskii
2018-11-23 20:38               ` Alan Third
2018-11-23 21:08                 ` Eli Zaretskii
2018-11-24  9:35                   ` Alan Third
2018-11-24  9:44                     ` Eli Zaretskii
2018-11-25 11:36                     ` Alan Third

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).