aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2023-04-15 12:43:37 -0400
committerEli Zaretskii2023-04-15 12:43:37 -0400
commit5fecdbcd81db3d4a06277400c458d8ca7dcf7462 (patch)
treee8a6e1cca4f6f7642a268575ecf5243347a87ee8 /src
parent4c086bf2951596d04677c343eb49fb32a3831e18 (diff)
parent5ef7ff05736b9d1b4d806cfe04ec5d99c090e748 (diff)
downloademacs-5fecdbcd81db3d4a06277400c458d8ca7dcf7462.tar.gz
emacs-5fecdbcd81db3d4a06277400c458d8ca7dcf7462.zip
Merge from origin/emacs-29
5ef7ff05736 ; Start a new ChangeLog.4 file. 11126c6d30a Fix 'C-h k' for "Paste from Kill Menu" in context menus 74ddfe811f9 ; * doc/misc/calc.texi (Rewrites Tutorial): Fix a typo (b... 08cda286c3f Improve the documentation of the XDS support 14d1c00e806 Allow reindentation of images inserted by 'mm-inline-image' b63a9eda01c Fix "C-h k" and "C-h c" with Paste from Kill Menu b36c21e27dc Change cursor color on NS port when it matches the face b... 96714c106b7 Improve documentation of image-related commands 6a2863ca016 Fix handling of sliced images 5be79fd05a5 ; * etc/NEWS: Announce 'cyrillic-mongolian' IM. ca1a0fda98a ; Fix last change. ce63462dbda Add cyrillic-mongolian input method 58801792706 ; Minor addition to the Emacs FAQ 88847dee125 Jsonrpc: don't bind inhibit-read-only to t so early cb8c87a423a Allow active region when IM is used # Conflicts: # etc/NEWS
Diffstat (limited to 'src')
-rw-r--r--src/macfont.m50
-rw-r--r--src/nsterm.m20
2 files changed, 47 insertions, 23 deletions
diff --git a/src/macfont.m b/src/macfont.m
index d0cdbcd08c7..9f9f6f4efaf 100644
--- a/src/macfont.m
+++ b/src/macfont.m
@@ -632,21 +632,35 @@ get_cgcolor_from_nscolor (NSColor *nsColor, struct frame *f)
632 632
633#define CG_SET_FILL_COLOR_WITH_FACE_FOREGROUND(context, face) \ 633#define CG_SET_FILL_COLOR_WITH_FACE_FOREGROUND(context, face) \
634 do { \ 634 do { \
635 CGColorRef refcol_ = get_cgcolor (NS_FACE_FOREGROUND (face)); \ 635 CGColorRef refcol = get_cgcolor (NS_FACE_FOREGROUND (face)); \
636 CGContextSetFillColorWithColor (context, refcol_) ; \ 636 CGContextSetFillColorWithColor (context, refcol); \
637 CGColorRelease (refcol_); \ 637 CGColorRelease (refcol); \
638 } while (0) 638 } while (0)
639#define CG_SET_FILL_COLOR_WITH_FACE_BACKGROUND(context, face) \ 639#define CG_SET_FILL_COLOR_WITH_FACE_BACKGROUND(context, face) \
640 do { \ 640 do { \
641 CGColorRef refcol_ = get_cgcolor (NS_FACE_BACKGROUND (face)); \ 641 CGColorRef refcol = get_cgcolor (NS_FACE_BACKGROUND (face)); \
642 CGContextSetFillColorWithColor (context, refcol_); \ 642 CGContextSetFillColorWithColor (context, refcol); \
643 CGColorRelease (refcol_); \ 643 CGColorRelease (refcol); \
644 } while (0)
645#define CG_SET_FILL_COLOR_WITH_FRAME_CURSOR(context, frame) \
646 do { \
647 CGColorRef refcol \
648 = get_cgcolor_from_nscolor (FRAME_CURSOR_COLOR (frame), frame); \
649 CGContextSetFillColorWithColor (context, refcol); \
650 CGColorRelease (refcol); \
651 } while (0)
652#define CG_SET_FILL_COLOR_WITH_FRAME_BACKGROUND(context, frame) \
653 do { \
654 CGColorRef refcol \
655 = get_cgcolor_from_nscolor (FRAME_BACKGROUND_COLOR (frame), frame); \
656 CGContextSetFillColorWithColor (context, refcol); \
657 CGColorRelease (refcol); \
644 } while (0) 658 } while (0)
645#define CG_SET_STROKE_COLOR_WITH_FACE_FOREGROUND(context, face) \ 659#define CG_SET_STROKE_COLOR_WITH_FACE_FOREGROUND(context, face) \
646 do { \ 660 do { \
647 CGColorRef refcol_ = get_cgcolor (NS_FACE_FOREGROUND (face)); \ 661 CGColorRef refcol = get_cgcolor (NS_FACE_FOREGROUND (face)); \
648 CGContextSetStrokeColorWithColor (context, refcol_); \ 662 CGContextSetStrokeColorWithColor (context, refcol); \
649 CGColorRelease (refcol_); \ 663 CGColorRelease (refcol); \
650 } while (0) 664 } while (0)
651 665
652 666
@@ -2933,9 +2947,12 @@ macfont_draw (struct glyph_string *s, int from, int to, int x, int y,
2933 { 2947 {
2934 if (s->hl == DRAW_CURSOR) 2948 if (s->hl == DRAW_CURSOR)
2935 { 2949 {
2936 CGColorRef colorref = get_cgcolor_from_nscolor (FRAME_CURSOR_COLOR (f), f); 2950 if (face && (NS_FACE_BACKGROUND (face)
2937 CGContextSetFillColorWithColor (context, colorref); 2951 == [(NSColor *) FRAME_CURSOR_COLOR (f)
2938 CGColorRelease (colorref); 2952 unsignedLong]))
2953 CG_SET_FILL_COLOR_WITH_FACE_FOREGROUND (context, face);
2954 else
2955 CG_SET_FILL_COLOR_WITH_FRAME_CURSOR (context, f);
2939 } 2956 }
2940 else 2957 else
2941 CG_SET_FILL_COLOR_WITH_FACE_BACKGROUND (context, face); 2958 CG_SET_FILL_COLOR_WITH_FACE_BACKGROUND (context, face);
@@ -2949,9 +2966,12 @@ macfont_draw (struct glyph_string *s, int from, int to, int x, int y,
2949 CGContextScaleCTM (context, 1, -1); 2966 CGContextScaleCTM (context, 1, -1);
2950 if (s->hl == DRAW_CURSOR) 2967 if (s->hl == DRAW_CURSOR)
2951 { 2968 {
2952 CGColorRef colorref = get_cgcolor_from_nscolor (FRAME_BACKGROUND_COLOR (f), f); 2969 if (face && (NS_FACE_BACKGROUND (face)
2953 CGContextSetFillColorWithColor (context, colorref); 2970 == [(NSColor *) FRAME_CURSOR_COLOR (f)
2954 CGColorRelease (colorref); 2971 unsignedLong]))
2972 CG_SET_FILL_COLOR_WITH_FACE_BACKGROUND (context, face);
2973 else
2974 CG_SET_FILL_COLOR_WITH_FRAME_BACKGROUND (context, f);
2955 } 2975 }
2956 else 2976 else
2957 CG_SET_FILL_COLOR_WITH_FACE_FOREGROUND (context, face); 2977 CG_SET_FILL_COLOR_WITH_FACE_FOREGROUND (context, face);
diff --git a/src/nsterm.m b/src/nsterm.m
index 87bdb44eadc..ecbf80ff72d 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -3750,14 +3750,18 @@ ns_maybe_dumpglyphs_background (struct glyph_string *s, char force_p)
3750 { 3750 {
3751 struct face *face = s->face; 3751 struct face *face = s->face;
3752 if (!face->stipple) 3752 if (!face->stipple)
3753 { 3753 {
3754 if (s->hl != DRAW_CURSOR) 3754 if (s->hl != DRAW_CURSOR)
3755 [(NS_FACE_BACKGROUND (face) != 0 3755 [(NS_FACE_BACKGROUND (face) != 0
3756 ? [NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)] 3756 ? [NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)]
3757 : FRAME_BACKGROUND_COLOR (s->f)) set]; 3757 : FRAME_BACKGROUND_COLOR (s->f)) set];
3758 else 3758 else if (face && (NS_FACE_BACKGROUND (face)
3759 [FRAME_CURSOR_COLOR (s->f) set]; 3759 == [(NSColor *) FRAME_CURSOR_COLOR (s->f)
3760 } 3760 unsignedLong]))
3761 [[NSColor colorWithUnsignedLong:NS_FACE_FOREGROUND (face)] set];
3762 else
3763 [FRAME_CURSOR_COLOR (s->f) set];
3764 }
3761 else 3765 else
3762 { 3766 {
3763 struct ns_display_info *dpyinfo = FRAME_DISPLAY_INFO (s->f); 3767 struct ns_display_info *dpyinfo = FRAME_DISPLAY_INFO (s->f);