emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master f1bf1a0698: Fix source reporting for focus in and focus out event


From: Po Lu
Subject: master f1bf1a0698: Fix source reporting for focus in and focus out events
Date: Fri, 8 Apr 2022 21:13:08 -0400 (EDT)

branch: master
commit f1bf1a069853315c0fa116ef4716ba38c9a67417
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Fix source reporting for focus in and focus out events
    
    * src/xterm.c (handle_one_xevent): Report source name for
    FocusIn and FocusOut events.
---
 src/xterm.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/xterm.c b/src/xterm.c
index 038dbcfe87..329376cab2 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -15866,8 +15866,10 @@ handle_one_xevent (struct x_display_info *dpyinfo,
          case XI_FocusIn:
            {
              XIFocusInEvent *focusin = (XIFocusInEvent *) xi_event;
+             struct xi_device_t *source;
 
              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
@@ -15895,16 +15897,25 @@ handle_one_xevent (struct x_display_info *dpyinfo,
                      XSETFRAME (inev.ie.frame_or_window, f);
                    }
                }
+
              x_detect_focus_change (dpyinfo, any, event, &inev.ie);
+
+             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;
 
              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);
+
+             if (inev.ie.kind != NO_EVENT && source)
+               inev.ie.device = source->name;
              goto XI_OTHER;
            }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]