aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-03-24 11:41:29 +0800
committerPo Lu2022-03-24 11:41:29 +0800
commitebd5725e0b2f7e1dcf6dcb068bef638edd7f0cb4 (patch)
treed28ce7ce1a77733ff91c39b9a88649094e112216 /src
parentd81df9e44933d5b4d386e29d953055dfc029e742 (diff)
downloademacs-ebd5725e0b2f7e1dcf6dcb068bef638edd7f0cb4.tar.gz
emacs-ebd5725e0b2f7e1dcf6dcb068bef638edd7f0cb4.zip
Fix an infinite loop if the window manager pings Emacs during DND
* src/xterm.c (handle_one_xevent): Work around _NET_WM_PING infinite loop during drag and drop.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 0543f152eda..fcc1f55ccb6 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -11014,7 +11014,19 @@ handle_one_xevent (struct x_display_info *dpyinfo,
11014 11014
11015 send_event.xclient.window = dpyinfo->root_window; 11015 send_event.xclient.window = dpyinfo->root_window;
11016 XSendEvent (dpyinfo->display, dpyinfo->root_window, False, 11016 XSendEvent (dpyinfo->display, dpyinfo->root_window, False,
11017 SubstructureRedirectMask | SubstructureNotifyMask, 11017 /* FIXME: handling window stacking changes
11018 during drag-and-drop requires Emacs to
11019 select for SubstructureNotifyMask,
11020 which in turn causes the message to be
11021 sent to Emacs itself using the event
11022 mask specified by the EWMH. To avoid
11023 an infinite loop, just use
11024 SubstructureRedirectMask when a
11025 drag-and-drop operation is in
11026 progress. */
11027 ((x_dnd_in_progress || x_dnd_waiting_for_finish)
11028 ? SubstructureRedirectMask
11029 : SubstructureRedirectMask | SubstructureNotifyMask),
11018 &send_event); 11030 &send_event);
11019 11031
11020 *finish = X_EVENT_DROP; 11032 *finish = X_EVENT_DROP;