From 03d16d6d4c0a3403f560b7d75c3f8f0bc75c528c Mon Sep 17 00:00:00 2001 From: Po Lu Date: Thu, 21 Apr 2022 13:52:50 +0800 Subject: [PATCH] Don't leave xm drag initiator info around * 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 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/xterm.c b/src/xterm.c index 0243b3cf96c..69e9302973c 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -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 -- 2.39.2