diff options
Diffstat (limited to 'src/pgtkterm.c')
| -rw-r--r-- | src/pgtkterm.c | 73 |
1 files changed, 44 insertions, 29 deletions
diff --git a/src/pgtkterm.c b/src/pgtkterm.c index 5d1716adcb8..437249abeba 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c | |||
| @@ -2367,14 +2367,29 @@ x_draw_stretch_glyph_string (struct glyph_string *s) | |||
| 2367 | else if (!s->background_filled_p) | 2367 | else if (!s->background_filled_p) |
| 2368 | { | 2368 | { |
| 2369 | int background_width = s->background_width; | 2369 | int background_width = s->background_width; |
| 2370 | int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA); | 2370 | int x = s->x, text_left_x = window_box_left_offset (s->w, TEXT_AREA); |
| 2371 | 2371 | ||
| 2372 | /* Don't draw into left margin, fringe or scrollbar area | 2372 | /* Don't draw into left fringe or scrollbar area except for |
| 2373 | except for header line and mode line. */ | 2373 | header line and mode line. */ |
| 2374 | if (x < left_x && !s->row->mode_line_p) | 2374 | if (x < text_left_x && !s->row->mode_line_p) |
| 2375 | { | 2375 | { |
| 2376 | background_width -= left_x - x; | 2376 | int left_x = WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH (s->w); |
| 2377 | x = left_x; | 2377 | int right_x = text_left_x; |
| 2378 | |||
| 2379 | if (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (s->w)) | ||
| 2380 | left_x += WINDOW_LEFT_FRINGE_WIDTH (s->w); | ||
| 2381 | else | ||
| 2382 | right_x -= WINDOW_LEFT_FRINGE_WIDTH (s->w); | ||
| 2383 | |||
| 2384 | /* Adjust X and BACKGROUND_WIDTH to fit inside the space | ||
| 2385 | between LEFT_X and RIGHT_X. */ | ||
| 2386 | if (x < left_x) | ||
| 2387 | { | ||
| 2388 | background_width -= left_x - x; | ||
| 2389 | x = left_x; | ||
| 2390 | } | ||
| 2391 | if (x + background_width > right_x) | ||
| 2392 | background_width = right_x - x; | ||
| 2378 | } | 2393 | } |
| 2379 | if (background_width > 0) | 2394 | if (background_width > 0) |
| 2380 | x_draw_glyph_string_bg_rect (s, x, s->y, background_width, s->height); | 2395 | x_draw_glyph_string_bg_rect (s, x, s->y, background_width, s->height); |
| @@ -5261,37 +5276,37 @@ pgtk_clear_under_internal_border (struct frame *f) | |||
| 5261 | int border = FRAME_INTERNAL_BORDER_WIDTH (f); | 5276 | int border = FRAME_INTERNAL_BORDER_WIDTH (f); |
| 5262 | int width = FRAME_PIXEL_WIDTH (f); | 5277 | int width = FRAME_PIXEL_WIDTH (f); |
| 5263 | int height = FRAME_PIXEL_HEIGHT (f); | 5278 | int height = FRAME_PIXEL_HEIGHT (f); |
| 5264 | int margin = 0; | 5279 | int margin = FRAME_TOP_MARGIN_HEIGHT (f); |
| 5265 | struct face *face = FACE_FROM_ID_OR_NULL (f, INTERNAL_BORDER_FACE_ID); | 5280 | int face_id = |
| 5281 | (FRAME_PARENT_FRAME (f) | ||
| 5282 | ? (!NILP (Vface_remapping_alist) | ||
| 5283 | ? lookup_basic_face (NULL, f, CHILD_FRAME_BORDER_FACE_ID) | ||
| 5284 | : CHILD_FRAME_BORDER_FACE_ID) | ||
| 5285 | : (!NILP (Vface_remapping_alist) | ||
| 5286 | ? lookup_basic_face (NULL, f, INTERNAL_BORDER_FACE_ID) | ||
| 5287 | : INTERNAL_BORDER_FACE_ID)); | ||
| 5288 | struct face *face = FACE_FROM_ID_OR_NULL (f, face_id); | ||
| 5266 | 5289 | ||
| 5267 | block_input (); | 5290 | block_input (); |
| 5268 | 5291 | ||
| 5269 | struct | ||
| 5270 | { | ||
| 5271 | int x, y, w, h; | ||
| 5272 | } rects[] = { | ||
| 5273 | {0, margin, width, border}, | ||
| 5274 | {0, 0, border, height}, | ||
| 5275 | {width - border, 0, border, height}, | ||
| 5276 | {0, height - border, width, border}, | ||
| 5277 | }; | ||
| 5278 | |||
| 5279 | if (face) | 5292 | if (face) |
| 5280 | { | 5293 | { |
| 5281 | for (int i = 0; i < 4; i++) | 5294 | #define x_fill_rectangle(f, gc, x, y, w, h) \ |
| 5282 | { | 5295 | fill_background_by_face (f, face, x, y, w, h) |
| 5283 | int x = rects[i].x; | 5296 | x_fill_rectangle (f, gc, 0, margin, width, border); |
| 5284 | int y = rects[i].y; | 5297 | x_fill_rectangle (f, gc, 0, 0, border, height); |
| 5285 | int w = rects[i].w; | 5298 | x_fill_rectangle (f, gc, width - border, 0, border, height); |
| 5286 | int h = rects[i].h; | 5299 | x_fill_rectangle (f, gc, 0, height - border, width, border); |
| 5287 | fill_background_by_face (f, face, x, y, w, h); | 5300 | #undef x_fill_rectangle |
| 5288 | } | ||
| 5289 | } | 5301 | } |
| 5290 | else | 5302 | else |
| 5291 | { | 5303 | { |
| 5292 | for (int i = 0; i < 4; i++) | 5304 | #define x_clear_area(f, x, y, w, h) pgtk_clear_area (f, x, y, w, h) |
| 5293 | pgtk_clear_area (f, rects[i].x, rects[i].y, rects[i].w, | 5305 | x_clear_area (f, 0, 0, border, height); |
| 5294 | rects[i].h); | 5306 | x_clear_area (f, 0, margin, width, border); |
| 5307 | x_clear_area (f, width - border, 0, border, height); | ||
| 5308 | x_clear_area (f, 0, height - border, width, border); | ||
| 5309 | #undef x_clear_area | ||
| 5295 | } | 5310 | } |
| 5296 | 5311 | ||
| 5297 | unblock_input (); | 5312 | unblock_input (); |