aboutsummaryrefslogtreecommitdiffstats
path: root/src/xterm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c37
1 files changed, 28 insertions, 9 deletions
diff --git a/src/xterm.c b/src/xterm.c
index cc06c48df33..2bfb8a15bb8 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -362,6 +362,7 @@ static void x_check_fullscreen P_ ((struct frame *));
362static void x_check_expected_move P_ ((struct frame *)); 362static void x_check_expected_move P_ ((struct frame *));
363static int handle_one_xevent P_ ((struct x_display_info *, XEvent *, 363static int handle_one_xevent P_ ((struct x_display_info *, XEvent *,
364 int *, struct input_event *)); 364 int *, struct input_event *));
365static SIGTYPE x_connection_closed P_ ((Display *, char *));
365 366
366 367
367/* Flush display of frame F, or of all frames if F is null. */ 368/* Flush display of frame F, or of all frames if F is null. */
@@ -2543,19 +2544,28 @@ x_draw_stretch_glyph_string (s)
2543 { 2544 {
2544 /* If `x-stretch-block-cursor' is nil, don't draw a block cursor 2545 /* If `x-stretch-block-cursor' is nil, don't draw a block cursor
2545 as wide as the stretch glyph. */ 2546 as wide as the stretch glyph. */
2546 int width = min (FRAME_COLUMN_WIDTH (s->f), s->background_width); 2547 int width, background_width = s->background_width;
2548 int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA);
2549
2550 if (x < left_x)
2551 {
2552 background_width -= left_x - x;
2553 x = left_x;
2554 }
2555 width = min (FRAME_COLUMN_WIDTH (s->f), background_width);
2547 2556
2548 /* Draw cursor. */ 2557 /* Draw cursor. */
2549 x_draw_glyph_string_bg_rect (s, s->x, s->y, width, s->height); 2558 x_draw_glyph_string_bg_rect (s, x, s->y, width, s->height);
2550 2559
2551 /* Clear rest using the GC of the original non-cursor face. */ 2560 /* Clear rest using the GC of the original non-cursor face. */
2552 if (width < s->background_width) 2561 if (width < background_width)
2553 { 2562 {
2554 int x = s->x + width, y = s->y; 2563 int y = s->y;
2555 int w = s->background_width - width, h = s->height; 2564 int w = background_width - width, h = s->height;
2556 XRectangle r; 2565 XRectangle r;
2557 GC gc; 2566 GC gc;
2558 2567
2568 x += width;
2559 if (s->row->mouse_face_p 2569 if (s->row->mouse_face_p
2560 && cursor_in_mouse_face_p (s->w)) 2570 && cursor_in_mouse_face_p (s->w))
2561 { 2571 {
@@ -2586,8 +2596,18 @@ x_draw_stretch_glyph_string (s)
2586 } 2596 }
2587 } 2597 }
2588 else if (!s->background_filled_p) 2598 else if (!s->background_filled_p)
2589 x_draw_glyph_string_bg_rect (s, s->x, s->y, s->background_width, 2599 {
2590 s->height); 2600 int background_width = s->background_width;
2601 int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA);
2602
2603 if (x < left_x)
2604 {
2605 background_width -= left_x - x;
2606 x = left_x;
2607 }
2608 if (background_width > 0)
2609 x_draw_glyph_string_bg_rect (s, x, s->y, background_width, s->height);
2610 }
2591 2611
2592 s->background_filled_p = 1; 2612 s->background_filled_p = 1;
2593} 2613}
@@ -7172,8 +7192,7 @@ x_draw_hollow_cursor (w, row)
7172 return; 7192 return;
7173 7193
7174 /* Compute frame-relative coordinates for phys cursor. */ 7194 /* Compute frame-relative coordinates for phys cursor. */
7175 x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x); 7195 get_phys_cursor_geometry (w, row, cursor_glyph, &x, &y, &h);
7176 y = get_phys_cursor_geometry (w, row, cursor_glyph, &h);
7177 wd = w->phys_cursor_width; 7196 wd = w->phys_cursor_width;
7178 7197
7179 /* The foreground of cursor_gc is typically the same as the normal 7198 /* The foreground of cursor_gc is typically the same as the normal