diff options
Diffstat (limited to 'src/xterm.c')
| -rw-r--r-- | src/xterm.c | 98 |
1 files changed, 51 insertions, 47 deletions
diff --git a/src/xterm.c b/src/xterm.c index 401b3ecfa4e..7dd19fa0993 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -548,22 +548,22 @@ static void | |||
| 548 | x_update_window_begin (struct window *w) | 548 | x_update_window_begin (struct window *w) |
| 549 | { | 549 | { |
| 550 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 550 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| 551 | struct x_display_info *display_info = FRAME_X_DISPLAY_INFO (f); | 551 | Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); |
| 552 | 552 | ||
| 553 | updated_window = w; | 553 | updated_window = w; |
| 554 | set_output_cursor (&w->cursor); | 554 | set_output_cursor (&w->cursor); |
| 555 | 555 | ||
| 556 | BLOCK_INPUT; | 556 | BLOCK_INPUT; |
| 557 | 557 | ||
| 558 | if (f == display_info->mouse_face_mouse_frame) | 558 | if (f == hlinfo->mouse_face_mouse_frame) |
| 559 | { | 559 | { |
| 560 | /* Don't do highlighting for mouse motion during the update. */ | 560 | /* Don't do highlighting for mouse motion during the update. */ |
| 561 | display_info->mouse_face_defer = 1; | 561 | hlinfo->mouse_face_defer = 1; |
| 562 | 562 | ||
| 563 | /* If F needs to be redrawn, simply forget about any prior mouse | 563 | /* If F needs to be redrawn, simply forget about any prior mouse |
| 564 | highlighting. */ | 564 | highlighting. */ |
| 565 | if (FRAME_GARBAGED_P (f)) | 565 | if (FRAME_GARBAGED_P (f)) |
| 566 | display_info->mouse_face_window = Qnil; | 566 | hlinfo->mouse_face_window = Qnil; |
| 567 | } | 567 | } |
| 568 | 568 | ||
| 569 | UNBLOCK_INPUT; | 569 | UNBLOCK_INPUT; |
| @@ -603,7 +603,7 @@ x_draw_vertical_window_border (struct window *w, int x, int y0, int y1) | |||
| 603 | static void | 603 | static void |
| 604 | x_update_window_end (struct window *w, int cursor_on_p, int mouse_face_overwritten_p) | 604 | x_update_window_end (struct window *w, int cursor_on_p, int mouse_face_overwritten_p) |
| 605 | { | 605 | { |
| 606 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (XFRAME (w->frame)); | 606 | Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); |
| 607 | 607 | ||
| 608 | if (!w->pseudo_window_p) | 608 | if (!w->pseudo_window_p) |
| 609 | { | 609 | { |
| @@ -624,9 +624,9 @@ x_update_window_end (struct window *w, int cursor_on_p, int mouse_face_overwritt | |||
| 624 | XTframe_up_to_date to redisplay the mouse highlight. */ | 624 | XTframe_up_to_date to redisplay the mouse highlight. */ |
| 625 | if (mouse_face_overwritten_p) | 625 | if (mouse_face_overwritten_p) |
| 626 | { | 626 | { |
| 627 | dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1; | 627 | hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; |
| 628 | dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; | 628 | hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; |
| 629 | dpyinfo->mouse_face_window = Qnil; | 629 | hlinfo->mouse_face_window = Qnil; |
| 630 | } | 630 | } |
| 631 | 631 | ||
| 632 | updated_window = NULL; | 632 | updated_window = NULL; |
| @@ -640,7 +640,7 @@ static void | |||
| 640 | x_update_end (struct frame *f) | 640 | x_update_end (struct frame *f) |
| 641 | { | 641 | { |
| 642 | /* Mouse highlight may be displayed again. */ | 642 | /* Mouse highlight may be displayed again. */ |
| 643 | FRAME_X_DISPLAY_INFO (f)->mouse_face_defer = 0; | 643 | MOUSE_HL_INFO (f)->mouse_face_defer = 0; |
| 644 | 644 | ||
| 645 | #ifndef XFlush | 645 | #ifndef XFlush |
| 646 | BLOCK_INPUT; | 646 | BLOCK_INPUT; |
| @@ -659,17 +659,17 @@ XTframe_up_to_date (struct frame *f) | |||
| 659 | { | 659 | { |
| 660 | if (FRAME_X_P (f)) | 660 | if (FRAME_X_P (f)) |
| 661 | { | 661 | { |
| 662 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 662 | Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); |
| 663 | 663 | ||
| 664 | if (dpyinfo->mouse_face_deferred_gc | 664 | if (hlinfo->mouse_face_deferred_gc |
| 665 | || f == dpyinfo->mouse_face_mouse_frame) | 665 | || f == hlinfo->mouse_face_mouse_frame) |
| 666 | { | 666 | { |
| 667 | BLOCK_INPUT; | 667 | BLOCK_INPUT; |
| 668 | if (dpyinfo->mouse_face_mouse_frame) | 668 | if (hlinfo->mouse_face_mouse_frame) |
| 669 | note_mouse_highlight (dpyinfo->mouse_face_mouse_frame, | 669 | note_mouse_highlight (hlinfo->mouse_face_mouse_frame, |
| 670 | dpyinfo->mouse_face_mouse_x, | 670 | hlinfo->mouse_face_mouse_x, |
| 671 | dpyinfo->mouse_face_mouse_y); | 671 | hlinfo->mouse_face_mouse_y); |
| 672 | dpyinfo->mouse_face_deferred_gc = 0; | 672 | hlinfo->mouse_face_deferred_gc = 0; |
| 673 | UNBLOCK_INPUT; | 673 | UNBLOCK_INPUT; |
| 674 | } | 674 | } |
| 675 | } | 675 | } |
| @@ -970,7 +970,7 @@ x_set_mouse_face_gc (struct glyph_string *s) | |||
| 970 | struct face *face; | 970 | struct face *face; |
| 971 | 971 | ||
| 972 | /* What face has to be used last for the mouse face? */ | 972 | /* What face has to be used last for the mouse face? */ |
| 973 | face_id = FRAME_X_DISPLAY_INFO (s->f)->mouse_face_face_id; | 973 | face_id = MOUSE_HL_INFO (s->f)->mouse_face_face_id; |
| 974 | face = FACE_FROM_ID (s->f, face_id); | 974 | face = FACE_FROM_ID (s->f, face_id); |
| 975 | if (face == NULL) | 975 | if (face == NULL) |
| 976 | face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); | 976 | face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); |
| @@ -5703,6 +5703,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventp, int *finish, | |||
| 5703 | struct frame *f = NULL; | 5703 | struct frame *f = NULL; |
| 5704 | struct coding_system coding; | 5704 | struct coding_system coding; |
| 5705 | XEvent event = *eventp; | 5705 | XEvent event = *eventp; |
| 5706 | Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight; | ||
| 5706 | 5707 | ||
| 5707 | *finish = X_EVENT_NORMAL; | 5708 | *finish = X_EVENT_NORMAL; |
| 5708 | 5709 | ||
| @@ -6152,12 +6153,12 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventp, int *finish, | |||
| 6152 | 6153 | ||
| 6153 | /* If mouse-highlight is an integer, input clears out | 6154 | /* If mouse-highlight is an integer, input clears out |
| 6154 | mouse highlighting. */ | 6155 | mouse highlighting. */ |
| 6155 | if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight) | 6156 | if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight) |
| 6156 | && (f == 0 | 6157 | && (f == 0 |
| 6157 | || !EQ (f->tool_bar_window, dpyinfo->mouse_face_window))) | 6158 | || !EQ (f->tool_bar_window, hlinfo->mouse_face_window))) |
| 6158 | { | 6159 | { |
| 6159 | clear_mouse_face (dpyinfo); | 6160 | clear_mouse_face (hlinfo); |
| 6160 | dpyinfo->mouse_face_hidden = 1; | 6161 | hlinfo->mouse_face_hidden = 1; |
| 6161 | } | 6162 | } |
| 6162 | 6163 | ||
| 6163 | #if defined USE_MOTIF && defined USE_TOOLKIT_SCROLL_BARS | 6164 | #if defined USE_MOTIF && defined USE_TOOLKIT_SCROLL_BARS |
| @@ -6514,12 +6515,12 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventp, int *finish, | |||
| 6514 | f = x_top_window_to_frame (dpyinfo, event.xcrossing.window); | 6515 | f = x_top_window_to_frame (dpyinfo, event.xcrossing.window); |
| 6515 | if (f) | 6516 | if (f) |
| 6516 | { | 6517 | { |
| 6517 | if (f == dpyinfo->mouse_face_mouse_frame) | 6518 | if (f == hlinfo->mouse_face_mouse_frame) |
| 6518 | { | 6519 | { |
| 6519 | /* If we move outside the frame, then we're | 6520 | /* If we move outside the frame, then we're |
| 6520 | certainly no longer on any text in the frame. */ | 6521 | certainly no longer on any text in the frame. */ |
| 6521 | clear_mouse_face (dpyinfo); | 6522 | clear_mouse_face (hlinfo); |
| 6522 | dpyinfo->mouse_face_mouse_frame = 0; | 6523 | hlinfo->mouse_face_mouse_frame = 0; |
| 6523 | } | 6524 | } |
| 6524 | 6525 | ||
| 6525 | /* Generate a nil HELP_EVENT to cancel a help-echo. | 6526 | /* Generate a nil HELP_EVENT to cancel a help-echo. |
| @@ -6552,10 +6553,10 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventp, int *finish, | |||
| 6552 | else | 6553 | else |
| 6553 | f = x_window_to_frame (dpyinfo, event.xmotion.window); | 6554 | f = x_window_to_frame (dpyinfo, event.xmotion.window); |
| 6554 | 6555 | ||
| 6555 | if (dpyinfo->mouse_face_hidden) | 6556 | if (hlinfo->mouse_face_hidden) |
| 6556 | { | 6557 | { |
| 6557 | dpyinfo->mouse_face_hidden = 0; | 6558 | hlinfo->mouse_face_hidden = 0; |
| 6558 | clear_mouse_face (dpyinfo); | 6559 | clear_mouse_face (hlinfo); |
| 6559 | } | 6560 | } |
| 6560 | 6561 | ||
| 6561 | #ifdef USE_GTK | 6562 | #ifdef USE_GTK |
| @@ -6610,7 +6611,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventp, int *finish, | |||
| 6610 | 6611 | ||
| 6611 | /* If we move outside the frame, then we're | 6612 | /* If we move outside the frame, then we're |
| 6612 | certainly no longer on any text in the frame. */ | 6613 | certainly no longer on any text in the frame. */ |
| 6613 | clear_mouse_face (dpyinfo); | 6614 | clear_mouse_face (hlinfo); |
| 6614 | } | 6615 | } |
| 6615 | 6616 | ||
| 6616 | /* If the contents of the global variable help_echo_string | 6617 | /* If the contents of the global variable help_echo_string |
| @@ -9304,6 +9305,7 @@ x_free_frame_resources (struct frame *f) | |||
| 9304 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 9305 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
| 9305 | Lisp_Object bar; | 9306 | Lisp_Object bar; |
| 9306 | struct scroll_bar *b; | 9307 | struct scroll_bar *b; |
| 9308 | Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight; | ||
| 9307 | 9309 | ||
| 9308 | BLOCK_INPUT; | 9310 | BLOCK_INPUT; |
| 9309 | 9311 | ||
| @@ -9397,15 +9399,15 @@ x_free_frame_resources (struct frame *f) | |||
| 9397 | if (f == dpyinfo->x_highlight_frame) | 9399 | if (f == dpyinfo->x_highlight_frame) |
| 9398 | dpyinfo->x_highlight_frame = 0; | 9400 | dpyinfo->x_highlight_frame = 0; |
| 9399 | 9401 | ||
| 9400 | if (f == dpyinfo->mouse_face_mouse_frame) | 9402 | if (f == hlinfo->mouse_face_mouse_frame) |
| 9401 | { | 9403 | { |
| 9402 | dpyinfo->mouse_face_beg_row | 9404 | hlinfo->mouse_face_beg_row |
| 9403 | = dpyinfo->mouse_face_beg_col = -1; | 9405 | = hlinfo->mouse_face_beg_col = -1; |
| 9404 | dpyinfo->mouse_face_end_row | 9406 | hlinfo->mouse_face_end_row |
| 9405 | = dpyinfo->mouse_face_end_col = -1; | 9407 | = hlinfo->mouse_face_end_col = -1; |
| 9406 | dpyinfo->mouse_face_window = Qnil; | 9408 | hlinfo->mouse_face_window = Qnil; |
| 9407 | dpyinfo->mouse_face_deferred_gc = 0; | 9409 | hlinfo->mouse_face_deferred_gc = 0; |
| 9408 | dpyinfo->mouse_face_mouse_frame = 0; | 9410 | hlinfo->mouse_face_mouse_frame = 0; |
| 9409 | } | 9411 | } |
| 9410 | 9412 | ||
| 9411 | UNBLOCK_INPUT; | 9413 | UNBLOCK_INPUT; |
| @@ -9782,6 +9784,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) | |||
| 9782 | struct terminal *terminal; | 9784 | struct terminal *terminal; |
| 9783 | struct x_display_info *dpyinfo; | 9785 | struct x_display_info *dpyinfo; |
| 9784 | XrmDatabase xrdb; | 9786 | XrmDatabase xrdb; |
| 9787 | Mouse_HLInfo *hlinfo; | ||
| 9785 | 9788 | ||
| 9786 | BLOCK_INPUT; | 9789 | BLOCK_INPUT; |
| 9787 | 9790 | ||
| @@ -9912,6 +9915,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) | |||
| 9912 | 9915 | ||
| 9913 | dpyinfo = (struct x_display_info *) xmalloc (sizeof (struct x_display_info)); | 9916 | dpyinfo = (struct x_display_info *) xmalloc (sizeof (struct x_display_info)); |
| 9914 | memset (dpyinfo, 0, sizeof *dpyinfo); | 9917 | memset (dpyinfo, 0, sizeof *dpyinfo); |
| 9918 | hlinfo = &dpyinfo->mouse_highlight; | ||
| 9915 | 9919 | ||
| 9916 | terminal = x_create_terminal (dpyinfo); | 9920 | terminal = x_create_terminal (dpyinfo); |
| 9917 | 9921 | ||
| @@ -10034,16 +10038,16 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) | |||
| 10034 | dpyinfo->bitmaps_size = 0; | 10038 | dpyinfo->bitmaps_size = 0; |
| 10035 | dpyinfo->bitmaps_last = 0; | 10039 | dpyinfo->bitmaps_last = 0; |
| 10036 | dpyinfo->scratch_cursor_gc = 0; | 10040 | dpyinfo->scratch_cursor_gc = 0; |
| 10037 | dpyinfo->mouse_face_mouse_frame = 0; | 10041 | hlinfo->mouse_face_mouse_frame = 0; |
| 10038 | dpyinfo->mouse_face_deferred_gc = 0; | 10042 | hlinfo->mouse_face_deferred_gc = 0; |
| 10039 | dpyinfo->mouse_face_beg_row = dpyinfo->mouse_face_beg_col = -1; | 10043 | hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; |
| 10040 | dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; | 10044 | hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; |
| 10041 | dpyinfo->mouse_face_face_id = DEFAULT_FACE_ID; | 10045 | hlinfo->mouse_face_face_id = DEFAULT_FACE_ID; |
| 10042 | dpyinfo->mouse_face_window = Qnil; | 10046 | hlinfo->mouse_face_window = Qnil; |
| 10043 | dpyinfo->mouse_face_overlay = Qnil; | 10047 | hlinfo->mouse_face_overlay = Qnil; |
| 10044 | dpyinfo->mouse_face_mouse_x = dpyinfo->mouse_face_mouse_y = 0; | 10048 | hlinfo->mouse_face_mouse_x = hlinfo->mouse_face_mouse_y = 0; |
| 10045 | dpyinfo->mouse_face_defer = 0; | 10049 | hlinfo->mouse_face_defer = 0; |
| 10046 | dpyinfo->mouse_face_hidden = 0; | 10050 | hlinfo->mouse_face_hidden = 0; |
| 10047 | dpyinfo->x_focus_frame = 0; | 10051 | dpyinfo->x_focus_frame = 0; |
| 10048 | dpyinfo->x_focus_event_frame = 0; | 10052 | dpyinfo->x_focus_event_frame = 0; |
| 10049 | dpyinfo->x_highlight_frame = 0; | 10053 | dpyinfo->x_highlight_frame = 0; |