emacs-diffs
[Top][All Lists]
Advanced

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

master 79f50e913d: Fix special DND event coordinates


From: Po Lu
Subject: master 79f50e913d: Fix special DND event coordinates
Date: Sun, 12 Jun 2022 21:11:23 -0400 (EDT)

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

    Fix special DND event coordinates
    
    * src/xterm.c (x_dnd_note_self_drop): Set DND action to
    XdndActionPrivate.
    (x_dnd_begin_drag_and_drop): Don't return XdndPrivate specially
    here.
    (handle_one_xevent): Fix order of arguments to
    x_dnd_note_self_drop.
---
 src/xterm.c | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index f2306a6015..b1e877566f 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -4303,6 +4303,11 @@ x_dnd_note_self_drop (struct x_display_info *dpyinfo, 
Window target,
                              &win_x, &win_y, &dummy))
     return;
 
+  /* Emacs can't respond to DND events inside the nested event
+     loop, so when dragging items to itself, always return
+     XdndActionPrivate.  */
+  x_dnd_action = dpyinfo->Xatom_XdndActionPrivate;
+
   EVENT_INIT (ie);
 
   ie.kind = DRAG_N_DROP_EVENT;
@@ -10805,7 +10810,6 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, 
Atom xaction,
 #endif
   XWindowAttributes root_window_attrs;
   struct input_event hold_quit;
-  struct frame *any;
   char *atom_name, *ask_actions;
   Lisp_Object action, ltimestamp;
   specpdl_ref ref, count, base;
@@ -11431,15 +11435,6 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, 
Atom xaction,
   x_dnd_return_frame_object = NULL;
   FRAME_DISPLAY_INFO (f)->grabbed = 0;
 
-  /* Emacs can't respond to DND events inside the nested event
-     loop, so when dragging items to itself, always return
-     XdndActionPrivate.  */
-  if (x_dnd_end_window != None
-      && (any = x_any_window_to_frame (FRAME_DISPLAY_INFO (f),
-                                      x_dnd_end_window))
-      && (allow_current_frame || any != f))
-    return unbind_to (base, QXdndActionPrivate);
-
   if (x_dnd_action != None)
     {
       block_input ();
@@ -18196,9 +18191,11 @@ handle_one_xevent (struct x_display_info *dpyinfo,
                        && x_dnd_last_window_is_frame)
                      {
                        x_dnd_waiting_for_finish = false;
-                       x_dnd_note_self_drop (dpyinfo, x_dnd_last_seen_window,
-                                             event->xbutton.time, 
event->xbutton.x_root,
-                                             event->xbutton.y_root);
+                       x_dnd_note_self_drop (dpyinfo,
+                                             x_dnd_last_seen_window,
+                                             event->xbutton.x_root,
+                                             event->xbutton.y_root,
+                                             event->xbutton.time);
                      }
                    else if (x_dnd_last_seen_window != None
                        && x_dnd_last_protocol_version != -1)
@@ -19596,7 +19593,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
                            {
                              x_dnd_waiting_for_finish = false;
                              x_dnd_note_self_drop (dpyinfo, 
x_dnd_last_seen_window,
-                                                   xev->time, xev->root_x, 
xev->root_y);
+                                                   xev->root_x, xev->root_y, 
xev->time);
                            }
                          else if (x_dnd_last_seen_window != None
                                   && x_dnd_last_protocol_version != -1)



reply via email to

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