comparison src/xterm.c @ 30160:432da5a9f734

(x_update_window_end): Add parameter MOUSE_FACE_OVERWRITTEN_P. If set, arrange for a mouse-highlight redisplay in XTframe_up_to_date. (x_clear_mouse_face): New function. (x_redisplay_interface): Add pointer to x_clear_mouse_face.
author Gerd Moellmann <gerd@gnu.org>
date Wed, 12 Jul 2000 15:09:53 +0000
parents 1eb41ec71ea5
children 73181a26fc85
comparison
equal deleted inserted replaced
30159:1b0331a7c724 30160:432da5a9f734
396 DRAW_MOUSE_FACE, 396 DRAW_MOUSE_FACE,
397 DRAW_IMAGE_RAISED, 397 DRAW_IMAGE_RAISED,
398 DRAW_IMAGE_SUNKEN 398 DRAW_IMAGE_SUNKEN
399 }; 399 };
400 400
401 static void x_update_window_end P_ ((struct window *, int)); 401 static void x_update_window_end P_ ((struct window *, int, int));
402 static void frame_to_window_pixel_xy P_ ((struct window *, int *, int *)); 402 static void frame_to_window_pixel_xy P_ ((struct window *, int *, int *));
403 void x_delete_display P_ ((struct x_display_info *)); 403 void x_delete_display P_ ((struct x_display_info *));
404 static unsigned int x_x_to_emacs_modifiers P_ ((struct x_display_info *, 404 static unsigned int x_x_to_emacs_modifiers P_ ((struct x_display_info *,
405 unsigned)); 405 unsigned));
406 static int fast_find_position P_ ((struct window *, int, int *, int *, 406 static int fast_find_position P_ ((struct window *, int, int *, int *,
655 f->output_data.x->normal_gc, x1, y0, x1, y1); 655 f->output_data.x->normal_gc, x1, y0, x1, y1);
656 } 656 }
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
666 static void 673 static void
667 x_update_window_end (w, cursor_on_p) 674 x_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 }
681 702
682 updated_window = NULL; 703 updated_window = NULL;
708 struct frame *f; 729 struct frame *f;
709 { 730 {
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 {
716 BLOCK_INPUT; 738 BLOCK_INPUT;
717 if (dpyinfo->mouse_face_mouse_frame) 739 if (dpyinfo->mouse_face_mouse_frame)
7076 7098
7077 dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1; 7099 dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1;
7078 dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; 7100 dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1;
7079 dpyinfo->mouse_face_window = Qnil; 7101 dpyinfo->mouse_face_window = Qnil;
7080 } 7102 }
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
7109 static void
7110 x_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
7081 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
7085 void 7125 void
13433 x_after_update_window_line, 13473 x_after_update_window_line,
13434 x_update_window_begin, 13474 x_update_window_begin,
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 };
13441 13482
13442 void 13483 void