diff options
| author | Po Lu | 2022-04-09 09:12:24 +0800 |
|---|---|---|
| committer | Po Lu | 2022-04-09 09:12:24 +0800 |
| commit | f1bf1a069853315c0fa116ef4716ba38c9a67417 (patch) | |
| tree | bb3bdd2607b6b6fc0ffefa37f176cdc6f6e27cb8 /src | |
| parent | 33d68da534ef4d6f7c4a6db3eaada8508c29f961 (diff) | |
| download | emacs-f1bf1a069853315c0fa116ef4716ba38c9a67417.tar.gz emacs-f1bf1a069853315c0fa116ef4716ba38c9a67417.zip | |
Fix source reporting for focus in and focus out events
* src/xterm.c (handle_one_xevent): Report source name for
FocusIn and FocusOut events.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/xterm.c b/src/xterm.c index 038dbcfe87d..329376cab2c 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -15866,8 +15866,10 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 15866 | case XI_FocusIn: | 15866 | case XI_FocusIn: |
| 15867 | { | 15867 | { |
| 15868 | XIFocusInEvent *focusin = (XIFocusInEvent *) xi_event; | 15868 | XIFocusInEvent *focusin = (XIFocusInEvent *) xi_event; |
| 15869 | struct xi_device_t *source; | ||
| 15869 | 15870 | ||
| 15870 | any = x_any_window_to_frame (dpyinfo, focusin->event); | 15871 | any = x_any_window_to_frame (dpyinfo, focusin->event); |
| 15872 | source = xi_device_from_id (dpyinfo, focusin->sourceid); | ||
| 15871 | #ifdef USE_GTK | 15873 | #ifdef USE_GTK |
| 15872 | /* Some WMs (e.g. Mutter in Gnome Shell), don't unmap | 15874 | /* Some WMs (e.g. Mutter in Gnome Shell), don't unmap |
| 15873 | minimized/iconified windows; thus, for those WMs we won't get | 15875 | minimized/iconified windows; thus, for those WMs we won't get |
| @@ -15895,16 +15897,25 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 15895 | XSETFRAME (inev.ie.frame_or_window, f); | 15897 | XSETFRAME (inev.ie.frame_or_window, f); |
| 15896 | } | 15898 | } |
| 15897 | } | 15899 | } |
| 15900 | |||
| 15898 | x_detect_focus_change (dpyinfo, any, event, &inev.ie); | 15901 | x_detect_focus_change (dpyinfo, any, event, &inev.ie); |
| 15902 | |||
| 15903 | if (inev.ie.kind != NO_EVENT && source) | ||
| 15904 | inev.ie.device = source->name; | ||
| 15899 | goto XI_OTHER; | 15905 | goto XI_OTHER; |
| 15900 | } | 15906 | } |
| 15901 | 15907 | ||
| 15902 | case XI_FocusOut: | 15908 | case XI_FocusOut: |
| 15903 | { | 15909 | { |
| 15904 | XIFocusOutEvent *focusout = (XIFocusOutEvent *) xi_event; | 15910 | XIFocusOutEvent *focusout = (XIFocusOutEvent *) xi_event; |
| 15911 | struct xi_device_t *source; | ||
| 15905 | 15912 | ||
| 15906 | any = x_any_window_to_frame (dpyinfo, focusout->event); | 15913 | any = x_any_window_to_frame (dpyinfo, focusout->event); |
| 15914 | source = xi_device_from_id (dpyinfo, focusout->sourceid); | ||
| 15907 | x_detect_focus_change (dpyinfo, any, event, &inev.ie); | 15915 | x_detect_focus_change (dpyinfo, any, event, &inev.ie); |
| 15916 | |||
| 15917 | if (inev.ie.kind != NO_EVENT && source) | ||
| 15918 | inev.ie.device = source->name; | ||
| 15908 | goto XI_OTHER; | 15919 | goto XI_OTHER; |
| 15909 | } | 15920 | } |
| 15910 | 15921 | ||