diff options
| author | Po Lu | 2022-08-11 09:56:15 +0800 |
|---|---|---|
| committer | Po Lu | 2022-08-11 09:56:15 +0800 |
| commit | edffda8609bd5828c08dceea30f2373bbcfe7c1c (patch) | |
| tree | 01f44d9744f99c1243d831481e1ff368e8c2f10e /src | |
| parent | e7b348b08ac5cea01141ece6b06f95c6d0b8c292 (diff) | |
| download | emacs-edffda8609bd5828c08dceea30f2373bbcfe7c1c.tar.gz 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.
Diffstat (limited to 'src')
| -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, | |||
| 17316 | union buffered_input_event inev; | 17316 | union buffered_input_event inev; |
| 17317 | int count = 0; | 17317 | int count = 0; |
| 17318 | int do_help = 0; | 17318 | int do_help = 0; |
| 17319 | #ifdef HAVE_XINPUT2 | ||
| 17320 | struct xi_device_t *gen_help_device; | ||
| 17321 | Time gen_help_time; | ||
| 17322 | #endif | ||
| 17319 | ptrdiff_t nbytes = 0; | 17323 | ptrdiff_t nbytes = 0; |
| 17320 | struct frame *any, *f = NULL; | 17324 | struct frame *any, *f = NULL; |
| 17321 | Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight; | 17325 | Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight; |
| @@ -17345,6 +17349,9 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 17345 | EVENT_INIT (inev.ie); | 17349 | EVENT_INIT (inev.ie); |
| 17346 | inev.ie.kind = NO_EVENT; | 17350 | inev.ie.kind = NO_EVENT; |
| 17347 | inev.ie.arg = Qnil; | 17351 | inev.ie.arg = Qnil; |
| 17352 | #ifdef HAVE_XINPUT2 | ||
| 17353 | gen_help_device = NULL; | ||
| 17354 | #endif | ||
| 17348 | 17355 | ||
| 17349 | /* Ignore events coming from various extensions, such as XFIXES and | 17356 | /* Ignore events coming from various extensions, such as XFIXES and |
| 17350 | XKB. */ | 17357 | XKB. */ |
| @@ -21270,7 +21277,15 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 21270 | has changed, generate a HELP_EVENT. */ | 21277 | has changed, generate a HELP_EVENT. */ |
| 21271 | if (!NILP (help_echo_string) | 21278 | if (!NILP (help_echo_string) |
| 21272 | || !NILP (previous_help_echo_string)) | 21279 | || !NILP (previous_help_echo_string)) |
| 21273 | do_help = 1; | 21280 | { |
| 21281 | /* Also allow the focus and client pointer to be | ||
| 21282 | adjusted accordingly, in case a help tooltip is | ||
| 21283 | shown. */ | ||
| 21284 | gen_help_device = device; | ||
| 21285 | gen_help_time = xev->time; | ||
| 21286 | |||
| 21287 | do_help = 1; | ||
| 21288 | } | ||
| 21274 | goto XI_OTHER; | 21289 | goto XI_OTHER; |
| 21275 | } | 21290 | } |
| 21276 | 21291 | ||
| @@ -23207,6 +23222,12 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 23207 | if (do_help > 0) | 23222 | if (do_help > 0) |
| 23208 | { | 23223 | { |
| 23209 | any_help_event_p = true; | 23224 | any_help_event_p = true; |
| 23225 | #ifdef HAVE_XINPUT2 | ||
| 23226 | if (gen_help_device) | ||
| 23227 | xi_handle_interaction (dpyinfo, f, | ||
| 23228 | gen_help_device, | ||
| 23229 | gen_help_time); | ||
| 23230 | #endif | ||
| 23210 | gen_help_event (help_echo_string, frame, help_echo_window, | 23231 | gen_help_event (help_echo_string, frame, help_echo_window, |
| 23211 | help_echo_object, help_echo_pos); | 23232 | help_echo_object, help_echo_pos); |
| 23212 | } | 23233 | } |