emacs-diffs
[Top][All Lists]
Advanced

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

master 5e07d1d0fc: Improve MPX interaction with xwidgets and drag-and-dr


From: Po Lu
Subject: master 5e07d1d0fc: Improve MPX interaction with xwidgets and drag-and-drop
Date: Tue, 9 Aug 2022 22:33:59 -0400 (EDT)

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

    Improve MPX interaction with xwidgets and drag-and-drop
    
    * src/xterm.c (handle_one_xevent): Handle focus interaction in
    more places.
---
 src/xterm.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index ab43a8ec51..41537ade15 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -21333,6 +21333,10 @@ handle_one_xevent (struct x_display_info *dpyinfo,
                    }
 #endif
 
+                 if (f && device)
+                   xi_handle_interaction (dpyinfo, f, device,
+                                          xev->time);
+
                  if (xev->evtype == XI_ButtonPress
                      && x_dnd_last_seen_window != None)
                    {
@@ -21579,11 +21583,19 @@ handle_one_xevent (struct x_display_info *dpyinfo,
                                              xev->send_event);
 
              source = xi_device_from_id (dpyinfo, xev->sourceid);
+             device = xi_device_from_id (dpyinfo, xev->deviceid);
 
 #ifdef HAVE_XWIDGETS
              xvw = xwidget_view_from_window (xev->event);
              if (xvw)
                {
+                 /* If the user interacts with a frame that's focused
+                    on another device, but not the current focus
+                    frame, make it the focus frame.  */
+                 if (device)
+                   xi_handle_interaction (dpyinfo, xvw->frame,
+                                          device, xev->time);
+
                  xwidget_button (xvw, xev->evtype == XI_ButtonPress,
                                  lrint (xev->event_x), lrint (xev->event_y),
                                  xev->detail, xi_convert_event_state (xev),
@@ -21603,8 +21615,6 @@ handle_one_xevent (struct x_display_info *dpyinfo,
                }
 #endif
 
-             device = xi_device_from_id (dpyinfo, xev->deviceid);
-
              if (!device)
                goto XI_OTHER;
 



reply via email to

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