emacs-diffs
[Top][All Lists]
Advanced

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

master 5bf409329b: Fix phantom drag-and-drop targets showing up in some


From: Po Lu
Subject: master 5bf409329b: Fix phantom drag-and-drop targets showing up in some programs
Date: Sun, 12 Jun 2022 04:42:19 -0400 (EDT)

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

    Fix phantom drag-and-drop targets showing up in some programs
    
    * src/xterm.c (x_dnd_cleanup_drag_and_drop)
    (x_dnd_begin_drag_and_drop): Delete XdndTypeList if it was set
    after the DND operation completes.  Some programs apparently
    think its presence on the drag source means there are more than
    3 targets.
---
 src/xterm.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/src/xterm.c b/src/xterm.c
index 842de55e2f..5ec6912fbd 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -4240,6 +4240,12 @@ x_dnd_cleanup_drag_and_drop (void *frame)
   if (x_dnd_motif_setup_p)
     XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
                     FRAME_DISPLAY_INFO (f)->Xatom_XdndSelection);
+
+  /* Remove any type list set as well.  */
+  if (x_dnd_init_type_lists && x_dnd_n_targets > 3)
+    XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+                    FRAME_DISPLAY_INFO (f)->Xatom_XdndTypeList);
+
   unblock_input ();
 
   x_dnd_frame = NULL;
@@ -11263,6 +11269,12 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, 
Atom xaction,
                XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
                                 FRAME_DISPLAY_INFO (f)->Xatom_XdndSelection);
 
+
+             /* Remove any type list set as well.  */
+             if (x_dnd_init_type_lists && x_dnd_n_targets > 3)
+               XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+                                FRAME_DISPLAY_INFO (f)->Xatom_XdndTypeList);
+
              /* Call kbd_buffer_store event, which calls
                 handle_interrupt and sets `last-event-frame' along
                 with various other things.  */
@@ -11348,6 +11360,12 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, 
Atom xaction,
              if (x_dnd_motif_setup_p)
                XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
                                 FRAME_DISPLAY_INFO (f)->Xatom_XdndSelection);
+
+
+             /* Remove any type list set as well.  */
+             if (x_dnd_init_type_lists && x_dnd_n_targets > 3)
+               XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+                                FRAME_DISPLAY_INFO (f)->Xatom_XdndTypeList);
              unblock_input ();
 
              quit ();
@@ -11386,6 +11404,11 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, 
Atom xaction,
   if (x_dnd_motif_setup_p)
     XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
                     FRAME_DISPLAY_INFO (f)->Xatom_XdndSelection);
+
+  /* Remove any type list set as well.  */
+  if (x_dnd_init_type_lists && x_dnd_n_targets > 3)
+    XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+                    FRAME_DISPLAY_INFO (f)->Xatom_XdndTypeList);
   unblock_input ();
 
   if (x_dnd_return_frame == 3



reply via email to

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