summaryrefslogtreecommitdiff
path: root/lisp/server.el
diff options
context:
space:
mode:
authorDaniel Colascione <dancol@dancol.org>2022-08-06 23:42:36 -0400
committerDaniel Colascione <dancol@dancol.org>2022-08-06 23:44:07 -0400
commit4b98a79a508ebdc719abfcf51ee6de32e46d0e1c (patch)
tree7580788968b149de63378447c91afeb88405f2cb /lisp/server.el
parent02ee0254873d4c102728c942dc9659f942c5cfa6 (diff)
downloademacs-4b98a79a508ebdc719abfcf51ee6de32e46d0e1c.tar.gz
emacs-4b98a79a508ebdc719abfcf51ee6de32e46d0e1c.tar.bz2
emacs-4b98a79a508ebdc719abfcf51ee6de32e46d0e1c.zip
Improve X event timestamp tracking
Fix two problems with our handling of X timestamps 1) We're not properly updating the X interaction timestamp after receiving certain input events, and 2) X events sent in response to emacsclient commands get stale timestamps because the timestamp tracking doesn't take into account that interactions with the user can occur outside the X input event channel. * src/xterm.c: (x_display_set_last_user_time_1): New function. (x_display_set_last_user_time): Call it. (x_ewmh_activate_frame): Refactor. (x_focus_frame): Don't call XSetInputFocus if we can use EWMH activation. (server_timestamp_predicate): New function. (x_get_server_time): New function. (x_note_oob_interaction): New function. (x_create_terminal): Register new function as terminal hook. * src/termhooks.h: New hook: note_oob_interaction_hook. * src/gtkutil.h: (xg_set_user_timestamp): Declare. * src/gtkutil.c: (xg_set_user_timestamp): New function. * src/frame.c: (Fframe_note_oob_interaction): New function. (syms_of_frame): Register it. * lisp/server.el: (server-switch-buffer): Call frame-note-oob-interaction when user requests frame be raised.
Diffstat (limited to 'lisp/server.el')
-rw-r--r--lisp/server.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/server.el b/lisp/server.el
index a06f2f952fd..cd3a8f80f0e 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -1721,7 +1721,9 @@ be a cons cell (LINENUMBER . COLUMNNUMBER)."
;; a minibuffer/dedicated-window (if there's no other).
(error (pop-to-buffer next-buffer)))))))
(when server-raise-frame
- (select-frame-set-input-focus (window-frame)))))
+ (let ((frame (window-frame)))
+ (frame-note-oob-interaction frame)
+ (select-frame-set-input-focus frame)))))
(defvar server-stop-automatically nil
"Internal status variable for `server-stop-automatically'.")