]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't leave xm drag initiator info around
authorPo Lu <luangruo@yahoo.com>
Thu, 21 Apr 2022 05:52:50 +0000 (13:52 +0800)
committerPo Lu <luangruo@yahoo.com>
Thu, 21 Apr 2022 05:53:43 +0000 (13:53 +0800)
* src/xterm.c (x_cleanup_drag_and_drop)
(x_begin_drag_and_drop): Don't confuse GTK+ 2.x by leaving drag
initiator info around after DND completes.

src/xterm.c

index 0243b3cf96c41f64f93add67bd14e159105fa112..69e9302973c3eab6fc1de46099a243f7b36585fe 100644 (file)
@@ -3707,6 +3707,11 @@ x_dnd_cleanup_drag_and_drop (void *frame)
     XkbSelectEvents (FRAME_X_DISPLAY (f), XkbUseCoreKbd,
                     XkbStateNotifyMask, 0);
 #endif
+
+  /* Delete the Motif drag initiator info if it was set up.  */
+  if (x_dnd_motif_setup_p)
+    XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+                    FRAME_DISPLAY_INFO (f)->Xatom_XdndSelection);
   unblock_input ();
 
   x_dnd_frame = NULL;
@@ -9891,6 +9896,10 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction,
            XkbSelectEvents (FRAME_X_DISPLAY (f), XkbUseCoreKbd,
                             XkbStateNotifyMask, 0);
 #endif
+         /* Delete the Motif drag initiator info if it was set up.  */
+         if (x_dnd_motif_setup_p)
+           XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+                            FRAME_DISPLAY_INFO (f)->Xatom_XdndSelection);
          quit ();
        }
     }
@@ -9913,6 +9922,10 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction,
     XkbSelectEvents (FRAME_X_DISPLAY (f), XkbUseCoreKbd,
                     XkbStateNotifyMask, 0);
 #endif
+  /* Delete the Motif drag initiator info if it was set up.  */
+  if (x_dnd_motif_setup_p)
+    XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+                    FRAME_DISPLAY_INFO (f)->Xatom_XdndSelection);
   unblock_input ();
 
   if (x_dnd_return_frame == 3