From: Po Lu Date: Wed, 6 Jul 2022 01:01:02 +0000 (+0800) Subject: Don't select for unnecessary properties during DND X-Git-Tag: emacs-29.0.90~1447^2~1155 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cd18cee96ee17562a276ea84bc9313e5bcbccb55;p=emacs.git 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. --- diff --git a/src/xterm.c b/src/xterm.c index 8373222cfc3..2643d1120f9 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);