diff options
| -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 | ||