summaryrefslogtreecommitdiff
path: root/src/nsterm.m
diff options
context:
space:
mode:
authorDaniel Martín <mardani29@yahoo.es>2023-04-02 22:39:44 +0200
committerEli Zaretskii <eliz@gnu.org>2023-04-08 14:35:30 +0300
commitb36c21e27dc6fa96c7c09b0e3a8fe9dcbdcea78b (patch)
tree31c27c27eb85ffa4d874a2f18e9c6ebb670d4a44 /src/nsterm.m
parent96714c106b7a3f86ca4c78052178a62d351f1751 (diff)
downloademacs-b36c21e27dc6fa96c7c09b0e3a8fe9dcbdcea78b.tar.gz
Change cursor color on NS port when it matches the face background
* src/macfont.m (CG_SET_FILL_COLOR_WITH_FRAME_CURSOR): New macro. (CG_SET_FILL_COLOR_WITH_FRAME_BACKGROUND): New macro. (macfont_draw): When the cursor's color matches the face background, set the fill color of the cursor to the face foreground. * src/nsterm.m (ns_maybe_dumpglyphs_background): When dumping the background of a glyph string, apply the logic mentioned above. (Bug#62573)
Diffstat (limited to 'src/nsterm.m')
-rw-r--r--src/nsterm.m20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/nsterm.m b/src/nsterm.m
index c9f955000ac..37462cf49e2 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -3750,14 +3750,18 @@ ns_maybe_dumpglyphs_background (struct glyph_string *s, char force_p)
{
struct face *face = s->face;
if (!face->stipple)
- {
- if (s->hl != DRAW_CURSOR)
- [(NS_FACE_BACKGROUND (face) != 0
- ? [NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)]
- : FRAME_BACKGROUND_COLOR (s->f)) set];
- else
- [FRAME_CURSOR_COLOR (s->f) set];
- }
+ {
+ if (s->hl != DRAW_CURSOR)
+ [(NS_FACE_BACKGROUND (face) != 0
+ ? [NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)]
+ : FRAME_BACKGROUND_COLOR (s->f)) set];
+ else if (face && (NS_FACE_BACKGROUND (face)
+ == [(NSColor *) FRAME_CURSOR_COLOR (s->f)
+ unsignedLong]))
+ [[NSColor colorWithUnsignedLong:NS_FACE_FOREGROUND (face)] set];
+ else
+ [FRAME_CURSOR_COLOR (s->f) set];
+ }
else
{
struct ns_display_info *dpyinfo = FRAME_DISPLAY_INFO (s->f);