[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master cd18cee96e 2/2: Don't select for unnecessary properties during DN
From: |
Po Lu |
Subject: |
master cd18cee96e 2/2: Don't select for unnecessary properties during DND |
Date: |
Tue, 5 Jul 2022 21:01:27 -0400 (EDT) |
branch: master
commit cd18cee96ee17562a276ea84bc9313e5bcbccb55
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Don't select for unnecessary properties during DND
* src/xterm.c (x_dnd_begin_drag_and_drop): Don't select for
property changes when not using toplevels.
---
src/xterm.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/xterm.c b/src/xterm.c
index 8373222cfc..2643d1120f 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -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);