summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-08-06 10:17:38 +0800
committerPo Lu <luangruo@yahoo.com>2022-08-06 10:17:38 +0800
commit32ab6d71058a35f784c644f5267ed0c72aeefcda (patch)
treed99856d2256b08c846b7c6e60dd6a8ac5b9e15bc /src
parent4e59830bc0ab17cdbd85748b133c97837bed99e3 (diff)
downloademacs-32ab6d71058a35f784c644f5267ed0c72aeefcda.tar.gz
emacs-32ab6d71058a35f784c644f5267ed0c72aeefcda.tar.bz2
emacs-32ab6d71058a35f784c644f5267ed0c72aeefcda.zip
Improve XI focus handling
* src/xterm.c (handle_one_xevent): Skip useless x_detect_focus_change calls in some cases.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 4bbcfb0e596..bb06ee1535c 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -20016,11 +20016,11 @@ handle_one_xevent (struct x_display_info *dpyinfo,
{
case XI_FocusIn:
{
- XIFocusInEvent *focusin = (XIFocusInEvent *) xi_event;
- struct xi_device_t *source;
+ XIFocusInEvent *focusin;
+ focusin = (XIFocusInEvent *) xi_event;
any = x_any_window_to_frame (dpyinfo, focusin->event);
- source = xi_device_from_id (dpyinfo, focusin->sourceid);
+
#ifdef USE_GTK
/* Some WMs (e.g. Mutter in Gnome Shell), don't unmap
minimized/iconified windows; thus, for those WMs we won't get
@@ -20049,24 +20049,19 @@ handle_one_xevent (struct x_display_info *dpyinfo,
}
}
- x_detect_focus_change (dpyinfo, any, event, &inev.ie);
+ xi_focus_handle_for_device (dpyinfo, any, xi_event);
- if (inev.ie.kind != NO_EVENT && source)
- inev.ie.device = source->name;
goto XI_OTHER;
}
case XI_FocusOut:
{
- XIFocusOutEvent *focusout = (XIFocusOutEvent *) xi_event;
- struct xi_device_t *source;
+ XIFocusOutEvent *focusout;
+ focusout = (XIFocusOutEvent *) xi_event;
any = x_any_window_to_frame (dpyinfo, focusout->event);
- source = xi_device_from_id (dpyinfo, focusout->sourceid);
- x_detect_focus_change (dpyinfo, any, event, &inev.ie);
+ xi_focus_handle_for_device (dpyinfo, any, xi_event);
- if (inev.ie.kind != NO_EVENT && source)
- inev.ie.device = source->name;
goto XI_OTHER;
}