aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c57
1 files changed, 49 insertions, 8 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 0fe950534e3..2a804dbc830 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -398,7 +398,7 @@ enum draw_glyphs_face
398 DRAW_IMAGE_SUNKEN 398 DRAW_IMAGE_SUNKEN
399}; 399};
400 400
401static void x_update_window_end P_ ((struct window *, int)); 401static void x_update_window_end P_ ((struct window *, int, int));
402static void frame_to_window_pixel_xy P_ ((struct window *, int *, int *)); 402static void frame_to_window_pixel_xy P_ ((struct window *, int *, int *));
403void x_delete_display P_ ((struct x_display_info *)); 403void x_delete_display P_ ((struct x_display_info *));
404static unsigned int x_x_to_emacs_modifiers P_ ((struct x_display_info *, 404static unsigned int x_x_to_emacs_modifiers P_ ((struct x_display_info *,
@@ -657,24 +657,45 @@ x_draw_vertical_border (w)
657} 657}
658 658
659 659
660/* End update of window W (which is equal to updated_window). Draw 660/* End update of window W (which is equal to updated_window).
661 vertical borders between horizontally adjacent windows, and display 661
662 W's cursor if CURSOR_ON_P is non-zero. W may be a menu bar 662 Draw vertical borders between horizontally adjacent windows, and
663 pseudo-window in case we don't have X toolkit support. Such 663 display W's cursor if CURSOR_ON_P is non-zero.
664 windows don't have a cursor, so don't display it here. */ 664
665 MOUSE_FACE_OVERWRITTEN_P non-zero means that some row containing
666 glyphs in mouse-face were overwritten. In that case we have to
667 make sure that the mouse-highlight is properly redrawn.
668
669 W may be a menu bar pseudo-window in case we don't have X toolkit
670 support. Such windows don't have a cursor, so don't display it
671 here. */
665 672
666static void 673static void
667x_update_window_end (w, cursor_on_p) 674x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p)
668 struct window *w; 675 struct window *w;
669 int cursor_on_p; 676 int cursor_on_p, mouse_face_overwritten_p;
670{ 677{
671 if (!w->pseudo_window_p) 678 if (!w->pseudo_window_p)
672 { 679 {
680 struct x_display_info *dpyinfo
681 = FRAME_X_DISPLAY_INFO (XFRAME (w->frame));
682
673 BLOCK_INPUT; 683 BLOCK_INPUT;
684
685 /* If a row with mouse-face was overwritten, arrange for
686 XTframe_up_to_date to redisplay the mouse highlight. */
687 if (mouse_face_overwritten_p)
688 {
689 dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1;
690 dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1;
691 dpyinfo->mouse_face_window = Qnil;
692 }
693
674 if (cursor_on_p) 694 if (cursor_on_p)
675 x_display_and_set_cursor (w, 1, output_cursor.hpos, 695 x_display_and_set_cursor (w, 1, output_cursor.hpos,
676 output_cursor.vpos, 696 output_cursor.vpos,
677 output_cursor.x, output_cursor.y); 697 output_cursor.x, output_cursor.y);
698
678 x_draw_vertical_border (w); 699 x_draw_vertical_border (w);
679 UNBLOCK_INPUT; 700 UNBLOCK_INPUT;
680 } 701 }
@@ -710,6 +731,7 @@ XTframe_up_to_date (f)
710 if (FRAME_X_P (f)) 731 if (FRAME_X_P (f))
711 { 732 {
712 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 733 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
734
713 if (dpyinfo->mouse_face_deferred_gc 735 if (dpyinfo->mouse_face_deferred_gc
714 || f == dpyinfo->mouse_face_mouse_frame) 736 || f == dpyinfo->mouse_face_mouse_frame)
715 { 737 {
@@ -7079,6 +7101,24 @@ clear_mouse_face (dpyinfo)
7079 dpyinfo->mouse_face_window = Qnil; 7101 dpyinfo->mouse_face_window = Qnil;
7080} 7102}
7081 7103
7104
7105/* Clear any mouse-face on window W. This function is part of the
7106 redisplay interface, and is called from try_window_id and similar
7107 functions to ensure the mouse-highlight is off. */
7108
7109static void
7110x_clear_mouse_face (w)
7111 struct window *w;
7112{
7113 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (XFRAME (w->frame));
7114 Lisp_Object window;
7115
7116 XSETWINDOW (window, w);
7117 if (EQ (window, dpyinfo->mouse_face_window))
7118 clear_mouse_face (dpyinfo);
7119}
7120
7121
7082/* Just discard the mouse face information for frame F, if any. 7122/* Just discard the mouse face information for frame F, if any.
7083 This is used when the size of F is changed. */ 7123 This is used when the size of F is changed. */
7084 7124
@@ -13435,6 +13475,7 @@ static struct redisplay_interface x_redisplay_interface =
13435 x_update_window_end, 13475 x_update_window_end,
13436 XTcursor_to, 13476 XTcursor_to,
13437 x_flush, 13477 x_flush,
13478 x_clear_mouse_face,
13438 x_get_glyph_overhangs, 13479 x_get_glyph_overhangs,
13439 x_fix_overlapping_area 13480 x_fix_overlapping_area
13440}; 13481};