]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't select for unnecessary properties during DND
authorPo Lu <luangruo@yahoo.com>
Wed, 6 Jul 2022 01:01:02 +0000 (09:01 +0800)
committerPo Lu <luangruo@yahoo.com>
Wed, 6 Jul 2022 01:01:02 +0000 (09:01 +0800)
* src/xterm.c (x_dnd_begin_drag_and_drop): Don't select for
property changes when not using toplevels.

src/xterm.c

index 8373222cfc32242b0909a0dcf4cf9011cf379534..2643d1120f9d55496e2014c5f8e83fe757518548 100644 (file)
@@ -11388,6 +11388,7 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction,
 #ifndef USE_GTK
   struct x_display_info *event_display;
 #endif
+  unsigned int additional_mask;
 
   base = SPECPDL_INDEX ();
 
@@ -11598,7 +11599,7 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction,
   if (EQ (return_frame, Qnow))
     x_dnd_return_frame = 2;
 
-  /* Now select for SubstructureNotifyMask and PropertyNotifyMask on
+  /* Now select for SubstructureNotifyMask and PropertyChangeMask on
      the root window, so we can get notified when window stacking
      changes, a common operation during drag-and-drop.  */
 
@@ -11606,11 +11607,15 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction,
                        FRAME_DISPLAY_INFO (f)->root_window,
                        &root_window_attrs);
 
+  additional_mask = SubstructureNotifyMask;
+
+  if (x_dnd_use_toplevels)
+    additional_mask |= PropertyChangeMask;
+
   XSelectInput (FRAME_X_DISPLAY (f),
                FRAME_DISPLAY_INFO (f)->root_window,
                root_window_attrs.your_event_mask
-               | SubstructureNotifyMask
-               | PropertyChangeMask);
+               | additional_mask);
 
   if (EQ (return_frame, Qnow))
     x_dnd_update_state (FRAME_DISPLAY_INFO (f), CurrentTime);