diff options
author | Po Lu <luangruo@yahoo.com> | 2022-08-11 09:56:15 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2022-08-11 09:56:15 +0800 |
commit | edffda8609bd5828c08dceea30f2373bbcfe7c1c (patch) | |
tree | 01f44d9744f99c1243d831481e1ff368e8c2f10e | |
parent | e7b348b08ac5cea01141ece6b06f95c6d0b8c292 (diff) | |
download | emacs-edffda8609bd5828c08dceea30f2373bbcfe7c1c.tar.gz emacs-edffda8609bd5828c08dceea30f2373bbcfe7c1c.tar.bz2 emacs-edffda8609bd5828c08dceea30f2373bbcfe7c1c.zip |
Adjust client pointer upon help event
* src/xterm.c (handle_one_xevent): Keep track of the device that
set do_help and make it the client pointer so that tooltips show
up under the right pointer.
-rw-r--r-- | src/xterm.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/xterm.c b/src/xterm.c index 17043e078c7..4372fdb959d 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -17316,6 +17316,10 @@ handle_one_xevent (struct x_display_info *dpyinfo, union buffered_input_event inev; int count = 0; int do_help = 0; +#ifdef HAVE_XINPUT2 + struct xi_device_t *gen_help_device; + Time gen_help_time; +#endif ptrdiff_t nbytes = 0; struct frame *any, *f = NULL; Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight; @@ -17345,6 +17349,9 @@ handle_one_xevent (struct x_display_info *dpyinfo, EVENT_INIT (inev.ie); inev.ie.kind = NO_EVENT; inev.ie.arg = Qnil; +#ifdef HAVE_XINPUT2 + gen_help_device = NULL; +#endif /* Ignore events coming from various extensions, such as XFIXES and XKB. */ @@ -21270,7 +21277,15 @@ handle_one_xevent (struct x_display_info *dpyinfo, has changed, generate a HELP_EVENT. */ if (!NILP (help_echo_string) || !NILP (previous_help_echo_string)) - do_help = 1; + { + /* Also allow the focus and client pointer to be + adjusted accordingly, in case a help tooltip is + shown. */ + gen_help_device = device; + gen_help_time = xev->time; + + do_help = 1; + } goto XI_OTHER; } @@ -23207,6 +23222,12 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (do_help > 0) { any_help_event_p = true; +#ifdef HAVE_XINPUT2 + if (gen_help_device) + xi_handle_interaction (dpyinfo, f, + gen_help_device, + gen_help_time); +#endif gen_help_event (help_echo_string, frame, help_echo_window, help_echo_object, help_echo_pos); } |