diff options
| author | Dmitry Antipov | 2013-09-12 11:29:33 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2013-09-12 11:29:33 +0400 |
| commit | 27e90f7752ed9d02cb98dd2dc2886a4f052240ab (patch) | |
| tree | 67aaa70e485a792e0e82ff247bdbad189cf6479a | |
| parent | 4a503aef7e09570c24ec7f68ddc8cb7470cc17ef (diff) | |
| download | emacs-27e90f7752ed9d02cb98dd2dc2886a4f052240ab.tar.gz emacs-27e90f7752ed9d02cb98dd2dc2886a4f052240ab.zip | |
* xterm.h (x_display_info): New field last_user_time...
* xterm.c (toplevel): ...to replace static last_user_time.
(handle_one_xevent, x_ewmh_activate_frame): Adjust users.
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/xterm.c | 31 | ||||
| -rw-r--r-- | src/xterm.h | 3 |
3 files changed, 23 insertions, 17 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 88aa22b30dc..069a9885b4c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,11 @@ | |||
| 1 | 2013-09-12 Dmitry Antipov <dmantipov@yandex.ru> | 1 | 2013-09-12 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 2 | ||
| 3 | * xterm.h (x_display_info): New field last_user_time... | ||
| 4 | * xterm.c (toplevel): ...to replace static last_user_time. | ||
| 5 | (handle_one_xevent, x_ewmh_activate_frame): Adjust users. | ||
| 6 | |||
| 7 | 2013-09-12 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 8 | |||
| 3 | * xterm.c (x_set_scroll_bar_thumb) [USE_LUCID && !HAVE_XAW3D]: Clip | 9 | * xterm.c (x_set_scroll_bar_thumb) [USE_LUCID && !HAVE_XAW3D]: Clip |
| 4 | scroll bar values to prevent thumb from disappear and update comment. | 10 | scroll bar values to prevent thumb from disappear and update comment. |
| 5 | 11 | ||
diff --git a/src/xterm.c b/src/xterm.c index cd60915e056..c28ca824063 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -230,10 +230,6 @@ static Lisp_Object last_mouse_scroll_bar; | |||
| 230 | 230 | ||
| 231 | static Time last_mouse_movement_time; | 231 | static Time last_mouse_movement_time; |
| 232 | 232 | ||
| 233 | /* Time for last user interaction as returned in X events. */ | ||
| 234 | |||
| 235 | static Time last_user_time; | ||
| 236 | |||
| 237 | /* Incremented by XTread_socket whenever it really tries to read | 233 | /* Incremented by XTread_socket whenever it really tries to read |
| 238 | events. */ | 234 | events. */ |
| 239 | 235 | ||
| @@ -5979,7 +5975,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr, | |||
| 5979 | break; | 5975 | break; |
| 5980 | 5976 | ||
| 5981 | case SelectionNotify: | 5977 | case SelectionNotify: |
| 5982 | last_user_time = event.xselection.time; | 5978 | dpyinfo->last_user_time = event.xselection.time; |
| 5983 | #ifdef USE_X_TOOLKIT | 5979 | #ifdef USE_X_TOOLKIT |
| 5984 | if (! x_window_to_frame (dpyinfo, event.xselection.requestor)) | 5980 | if (! x_window_to_frame (dpyinfo, event.xselection.requestor)) |
| 5985 | goto OTHER; | 5981 | goto OTHER; |
| @@ -5988,7 +5984,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr, | |||
| 5988 | break; | 5984 | break; |
| 5989 | 5985 | ||
| 5990 | case SelectionClear: /* Someone has grabbed ownership. */ | 5986 | case SelectionClear: /* Someone has grabbed ownership. */ |
| 5991 | last_user_time = event.xselectionclear.time; | 5987 | dpyinfo->last_user_time = event.xselectionclear.time; |
| 5992 | #ifdef USE_X_TOOLKIT | 5988 | #ifdef USE_X_TOOLKIT |
| 5993 | if (! x_window_to_frame (dpyinfo, event.xselectionclear.window)) | 5989 | if (! x_window_to_frame (dpyinfo, event.xselectionclear.window)) |
| 5994 | goto OTHER; | 5990 | goto OTHER; |
| @@ -6004,7 +6000,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr, | |||
| 6004 | break; | 6000 | break; |
| 6005 | 6001 | ||
| 6006 | case SelectionRequest: /* Someone wants our selection. */ | 6002 | case SelectionRequest: /* Someone wants our selection. */ |
| 6007 | last_user_time = event.xselectionrequest.time; | 6003 | dpyinfo->last_user_time = event.xselectionrequest.time; |
| 6008 | #ifdef USE_X_TOOLKIT | 6004 | #ifdef USE_X_TOOLKIT |
| 6009 | if (!x_window_to_frame (dpyinfo, event.xselectionrequest.owner)) | 6005 | if (!x_window_to_frame (dpyinfo, event.xselectionrequest.owner)) |
| 6010 | goto OTHER; | 6006 | goto OTHER; |
| @@ -6023,7 +6019,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr, | |||
| 6023 | break; | 6019 | break; |
| 6024 | 6020 | ||
| 6025 | case PropertyNotify: | 6021 | case PropertyNotify: |
| 6026 | last_user_time = event.xproperty.time; | 6022 | dpyinfo->last_user_time = event.xproperty.time; |
| 6027 | f = x_top_window_to_frame (dpyinfo, event.xproperty.window); | 6023 | f = x_top_window_to_frame (dpyinfo, event.xproperty.window); |
| 6028 | if (f && event.xproperty.atom == dpyinfo->Xatom_net_wm_state) | 6024 | if (f && event.xproperty.atom == dpyinfo->Xatom_net_wm_state) |
| 6029 | if (x_handle_net_wm_state (f, &event.xproperty) | 6025 | if (x_handle_net_wm_state (f, &event.xproperty) |
| @@ -6223,7 +6219,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr, | |||
| 6223 | 6219 | ||
| 6224 | case KeyPress: | 6220 | case KeyPress: |
| 6225 | 6221 | ||
| 6226 | last_user_time = event.xkey.time; | 6222 | dpyinfo->last_user_time = event.xkey.time; |
| 6227 | ignore_next_mouse_click_timeout = 0; | 6223 | ignore_next_mouse_click_timeout = 0; |
| 6228 | 6224 | ||
| 6229 | #if defined (USE_X_TOOLKIT) || defined (USE_GTK) | 6225 | #if defined (USE_X_TOOLKIT) || defined (USE_GTK) |
| @@ -6554,7 +6550,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr, | |||
| 6554 | #endif | 6550 | #endif |
| 6555 | 6551 | ||
| 6556 | case KeyRelease: | 6552 | case KeyRelease: |
| 6557 | last_user_time = event.xkey.time; | 6553 | dpyinfo->last_user_time = event.xkey.time; |
| 6558 | #ifdef HAVE_X_I18N | 6554 | #ifdef HAVE_X_I18N |
| 6559 | /* Don't dispatch this event since XtDispatchEvent calls | 6555 | /* Don't dispatch this event since XtDispatchEvent calls |
| 6560 | XFilterEvent, and two calls in a row may freeze the | 6556 | XFilterEvent, and two calls in a row may freeze the |
| @@ -6565,7 +6561,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr, | |||
| 6565 | #endif | 6561 | #endif |
| 6566 | 6562 | ||
| 6567 | case EnterNotify: | 6563 | case EnterNotify: |
| 6568 | last_user_time = event.xcrossing.time; | 6564 | dpyinfo->last_user_time = event.xcrossing.time; |
| 6569 | x_detect_focus_change (dpyinfo, &event, &inev.ie); | 6565 | x_detect_focus_change (dpyinfo, &event, &inev.ie); |
| 6570 | 6566 | ||
| 6571 | f = x_any_window_to_frame (dpyinfo, event.xcrossing.window); | 6567 | f = x_any_window_to_frame (dpyinfo, event.xcrossing.window); |
| @@ -6590,7 +6586,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr, | |||
| 6590 | goto OTHER; | 6586 | goto OTHER; |
| 6591 | 6587 | ||
| 6592 | case LeaveNotify: | 6588 | case LeaveNotify: |
| 6593 | last_user_time = event.xcrossing.time; | 6589 | dpyinfo->last_user_time = event.xcrossing.time; |
| 6594 | x_detect_focus_change (dpyinfo, &event, &inev.ie); | 6590 | x_detect_focus_change (dpyinfo, &event, &inev.ie); |
| 6595 | 6591 | ||
| 6596 | f = x_top_window_to_frame (dpyinfo, event.xcrossing.window); | 6592 | f = x_top_window_to_frame (dpyinfo, event.xcrossing.window); |
| @@ -6624,7 +6620,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr, | |||
| 6624 | 6620 | ||
| 6625 | case MotionNotify: | 6621 | case MotionNotify: |
| 6626 | { | 6622 | { |
| 6627 | last_user_time = event.xmotion.time; | 6623 | dpyinfo->last_user_time = event.xmotion.time; |
| 6628 | previous_help_echo_string = help_echo_string; | 6624 | previous_help_echo_string = help_echo_string; |
| 6629 | help_echo_string = Qnil; | 6625 | help_echo_string = Qnil; |
| 6630 | 6626 | ||
| @@ -6767,9 +6763,9 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr, | |||
| 6767 | by the rest of Emacs, we put it here. */ | 6763 | by the rest of Emacs, we put it here. */ |
| 6768 | bool tool_bar_p = 0; | 6764 | bool tool_bar_p = 0; |
| 6769 | 6765 | ||
| 6770 | memset (&compose_status, 0, sizeof (compose_status)); | 6766 | memset (&compose_status, 0, sizeof (compose_status)); |
| 6771 | last_mouse_glyph_frame = 0; | 6767 | last_mouse_glyph_frame = 0; |
| 6772 | last_user_time = event.xbutton.time; | 6768 | dpyinfo->last_user_time = event.xbutton.time; |
| 6773 | 6769 | ||
| 6774 | if (dpyinfo->grabbed | 6770 | if (dpyinfo->grabbed |
| 6775 | && last_mouse_frame | 6771 | && last_mouse_frame |
| @@ -8859,8 +8855,9 @@ x_ewmh_activate_frame (struct frame *f) | |||
| 8859 | Lisp_Object frame; | 8855 | Lisp_Object frame; |
| 8860 | XSETFRAME (frame, f); | 8856 | XSETFRAME (frame, f); |
| 8861 | x_send_client_event (frame, make_number (0), frame, | 8857 | x_send_client_event (frame, make_number (0), frame, |
| 8862 | dpyinfo->Xatom_net_active_window, | 8858 | dpyinfo->Xatom_net_active_window, |
| 8863 | make_number (32), list2i (1, last_user_time)); | 8859 | make_number (32), |
| 8860 | list2i (1, dpyinfo->last_user_time)); | ||
| 8864 | } | 8861 | } |
| 8865 | } | 8862 | } |
| 8866 | 8863 | ||
diff --git a/src/xterm.h b/src/xterm.h index f4a2d4c01b2..bdc8523009a 100644 --- a/src/xterm.h +++ b/src/xterm.h | |||
| @@ -301,6 +301,9 @@ struct x_display_info | |||
| 301 | minibuffer. */ | 301 | minibuffer. */ |
| 302 | struct frame *x_highlight_frame; | 302 | struct frame *x_highlight_frame; |
| 303 | 303 | ||
| 304 | /* Time of last user interaction as returned in X events on this display. */ | ||
| 305 | Time last_user_time; | ||
| 306 | |||
| 304 | /* The gray pixmap. */ | 307 | /* The gray pixmap. */ |
| 305 | Pixmap gray; | 308 | Pixmap gray; |
| 306 | 309 | ||