bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#62573: 29.0.60; Cursor color not being inverted in emacs-29


From: Po Lu
Subject: bug#62573: 29.0.60; Cursor color not being inverted in emacs-29
Date: Sun, 02 Apr 2023 08:44:09 +0800
User-agent: Gnus/5.13 (Gnus v5.13)

Daniel Martín <mardani29@yahoo.es> writes:

> I've solved the bug by replicating that logic in the appropriate places,
> nsterm.m and macfont.m:

Nice, thanks.

> +              CGColorRef colorref = get_cgcolor_from_nscolor 
> (FRAME_CURSOR_COLOR (f), f);

This row is now wider than 80 columns.  Please wrap it.

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

Please write:

  (face && (NS_FACE_BACKGROUND (face)
            == [(NSColor *) FRAME_CURSOR_COLOR (s->f)
                  unsignedLong]))

instead.

> Could you give it a try on macOS and GNUstep?  Thank you.

Works for me, thanks.

P.S. I think what needs to be done is to make the NS port keep track of
glyph string colors through GCs, so that the relevant code can be easily
synchronized with X.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]