From a53546cccda9e2426fe9166df262d64e46bc0970 Mon Sep 17 00:00:00 2001 From: Daniel Pettersson Date: Mon, 24 Jun 2024 23:16:59 +0200 Subject: [PATCH] Fix inconsistency in bitmap overlay drawing for macOS * src/nsterm.m (ns_draw_fringe_bitmap): Respect 'overlay_p', by not clearing fringe if set, as its done in xterm. (Bug#71763) (cherry picked from commit 87358e94047c7f86af1f1ac9d9469553dcd6a6e1) --- src/nsterm.m | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/nsterm.m b/src/nsterm.m index f68a22d9fbc..ad3b8ba8487 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -2961,24 +2961,28 @@ ns_draw_fringe_bitmap (struct window *w, struct glyph_row *row, NSTRACE_MSG ("which:%d cursor:%d overlay:%d width:%d height:%d period:%d", p->which, p->cursor_p, p->overlay_p, p->wd, p->h, p->dh); - /* Work out the rectangle we will need to clear. */ - clearRect = NSMakeRect (p->x, p->y, p->wd, p->h); + /* Clear screen unless overlay. */ + if ( !p->overlay_p ) + { + /* Work out the rectangle we will need to clear. */ + clearRect = NSMakeRect (p->x, p->y, p->wd, p->h); - if (p->bx >= 0 && !p->overlay_p) - clearRect = NSUnionRect (clearRect, NSMakeRect (p->bx, p->by, p->nx, p->ny)); + if ( p->bx >= 0 ) + clearRect = NSUnionRect (clearRect, NSMakeRect (p->bx, p->by, p->nx, p->ny)); - /* Handle partially visible rows. */ - clearRect = NSIntersectionRect (clearRect, rowRect); + /* Handle partially visible rows. */ + clearRect = NSIntersectionRect (clearRect, rowRect); - /* The visible portion of imageRect will always be contained within - clearRect. */ - ns_focus (f, &clearRect, 1); - if (! NSIsEmptyRect (clearRect)) - { - NSTRACE_RECT ("clearRect", clearRect); + /* The visible portion of imageRect will always be contained + within clearRect. */ + ns_focus (f, &clearRect, 1); + if ( !NSIsEmptyRect (clearRect) ) + { + NSTRACE_RECT ("clearRect", clearRect); - [[NSColor colorWithUnsignedLong:face->background] set]; - NSRectFill (clearRect); + [[NSColor colorWithUnsignedLong:face->background] set]; + NSRectFill (clearRect); + } } NSBezierPath *bmp = [fringe_bmp objectForKey:[NSNumber numberWithInt:p->which]]; -- 2.39.5