]> git.eshelyaron.com Git - emacs.git/commitdiff
Minor fixes to treatment of `allow_current_frame'
authorPo Lu <luangruo@yahoo.com>
Thu, 31 Mar 2022 10:52:01 +0000 (18:52 +0800)
committerPo Lu <luangruo@yahoo.com>
Thu, 31 Mar 2022 10:52:01 +0000 (18:52 +0800)
* src/xterm.c (x_dnd_send_drop): Don't send special event for
wrong frame.
(x_dnd_send_drop): Fix condition for returning
XdndActionPrivate.

src/xterm.c

index 6a19828a36aac9389f9503e5f64d817431d7baf3..81b84c8609c96bfc67ee6f04d4f911621764e1e8 100644 (file)
@@ -2502,6 +2502,10 @@ x_dnd_send_drop (struct frame *f, Window target, Time timestamp,
 
   if (self_frame)
     {
+      if (!x_dnd_allow_current_frame
+         && self_frame == x_dnd_frame)
+       return false;
+
       /* Send a special drag-and-drop event when dropping on top of an
         Emacs frame to avoid all the overhead involved with sending
         client events.  */
@@ -8625,7 +8629,7 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction,
   if (x_dnd_end_window != None
       && (any = x_any_window_to_frame (FRAME_DISPLAY_INFO (f),
                                       x_dnd_end_window))
-      && (any != f))
+      && (allow_current_frame || any != f))
     return QXdndActionPrivate;
 
   if (x_dnd_action != None)