diff options
| author | Alan Third | 2025-06-06 21:45:20 +0100 |
|---|---|---|
| committer | Alan Third | 2025-07-26 12:00:02 +0100 |
| commit | e3380669ed6db7a1c1574c4b39d58f9200a3ffab (patch) | |
| tree | 5acfffd84beacd7a4ba361075142a9d624b7d0a5 /src | |
| parent | 8c5378b2c2994731e5a37813681092cfba62ace7 (diff) | |
| download | emacs-e3380669ed6db7a1c1574c4b39d58f9200a3ffab.tar.gz emacs-e3380669ed6db7a1c1574c4b39d58f9200a3ffab.zip | |
Fix incorrectly nested ns_focus/ns_unfocus calls
* src/nsterm.m (ns_draw_fringe_bitmap): Move the call to ns_focus out of
the if for overlay_p and rename the rect from clearRect to bmpRect to
make it's purpose clearer.
Diffstat (limited to 'src')
| -rw-r--r-- | src/nsterm.m | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/src/nsterm.m b/src/nsterm.m index 38e49406d66..1d86fab3db5 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -3035,35 +3035,32 @@ ns_draw_fringe_bitmap (struct window *w, struct glyph_row *row, | |||
| 3035 | 3035 | ||
| 3036 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 3036 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| 3037 | struct face *face = p->face; | 3037 | struct face *face = p->face; |
| 3038 | NSRect clearRect = NSZeroRect; | 3038 | NSRect bmpRect = NSZeroRect; |
| 3039 | NSRect rowRect = ns_row_rect (w, row, ANY_AREA); | 3039 | NSRect rowRect = ns_row_rect (w, row, ANY_AREA); |
| 3040 | 3040 | ||
| 3041 | NSTRACE_WHEN (NSTRACE_GROUP_FRINGE, "ns_draw_fringe_bitmap"); | 3041 | NSTRACE_WHEN (NSTRACE_GROUP_FRINGE, "ns_draw_fringe_bitmap"); |
| 3042 | NSTRACE_MSG ("which:%d cursor:%d overlay:%d width:%d height:%d period:%d", | 3042 | NSTRACE_MSG ("which:%d cursor:%d overlay:%d width:%d height:%d period:%d", |
| 3043 | p->which, p->cursor_p, p->overlay_p, p->wd, p->h, p->dh); | 3043 | p->which, p->cursor_p, p->overlay_p, p->wd, p->h, p->dh); |
| 3044 | 3044 | ||
| 3045 | /* Clear screen unless overlay. */ | 3045 | /* Work out the rectangle we will need to clear. */ |
| 3046 | if (!p->overlay_p) | 3046 | bmpRect = NSMakeRect (p->x, p->y, p->wd, p->h); |
| 3047 | { | ||
| 3048 | /* Work out the rectangle we will need to clear. */ | ||
| 3049 | clearRect = NSMakeRect (p->x, p->y, p->wd, p->h); | ||
| 3050 | 3047 | ||
| 3051 | if (p->bx >= 0) | 3048 | if (p->bx >= 0) |
| 3052 | clearRect = NSUnionRect (clearRect, NSMakeRect (p->bx, p->by, p->nx, p->ny)); | 3049 | bmpRect = NSUnionRect (bmpRect, NSMakeRect (p->bx, p->by, p->nx, p->ny)); |
| 3053 | 3050 | ||
| 3054 | /* Handle partially visible rows. */ | 3051 | /* Handle partially visible rows. */ |
| 3055 | clearRect = NSIntersectionRect (clearRect, rowRect); | 3052 | bmpRect = NSIntersectionRect (bmpRect, rowRect); |
| 3056 | 3053 | ||
| 3057 | /* The visible portion of imageRect will always be contained | 3054 | /* Clip to the bitmap's area. */ |
| 3058 | within clearRect. */ | 3055 | ns_focus (f, &bmpRect, 1); |
| 3059 | ns_focus (f, &clearRect, 1); | ||
| 3060 | if (!NSIsEmptyRect (clearRect)) | ||
| 3061 | { | ||
| 3062 | NSTRACE_RECT ("clearRect", clearRect); | ||
| 3063 | 3056 | ||
| 3064 | [[NSColor colorWithUnsignedLong:face->background] set]; | 3057 | /* Clear screen unless overlay. */ |
| 3065 | NSRectFill (clearRect); | 3058 | if (!p->overlay_p && !NSIsEmptyRect (clearRect)) |
| 3066 | } | 3059 | { |
| 3060 | NSTRACE_RECT ("clearRect", clearRect); | ||
| 3061 | |||
| 3062 | [[NSColor colorWithUnsignedLong:face->background] set]; | ||
| 3063 | NSRectFill (clearRect); | ||
| 3067 | } | 3064 | } |
| 3068 | 3065 | ||
| 3069 | NSBezierPath *bmp = [fringe_bmp objectForKey:[NSNumber numberWithInt:p->which]]; | 3066 | NSBezierPath *bmp = [fringe_bmp objectForKey:[NSNumber numberWithInt:p->which]]; |