[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master fbe7ac16d7: Fix replying to _NET_WM_PING during drag-and-drop
From: |
Po Lu |
Subject: |
master fbe7ac16d7: Fix replying to _NET_WM_PING during drag-and-drop |
Date: |
Tue, 31 May 2022 06:19:14 -0400 (EDT) |
branch: master
commit fbe7ac16d722f786e5f3f2e3a916b1aa79510eb5
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Fix replying to _NET_WM_PING during drag-and-drop
* src/xterm.c (handle_one_xevent): Test client window against
root window instead of using nonstandard event mask.
---
src/xterm.c | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)
diff --git a/src/xterm.c b/src/xterm.c
index 0ebabdccaf..fb7d18a53f 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -15246,25 +15246,23 @@ handle_one_xevent (struct x_display_info *dpyinfo,
if (event->xclient.data.l[0] == dpyinfo->Xatom_net_wm_ping
+ /* Handling window stacking changes during
+ drag-and-drop requires Emacs to select for
+ SubstructureNotifyMask, which in turn causes the
+ message to be sent to Emacs itself using the event
+ mask specified by the EWMH. To avoid an infinite
+ loop, make sure the client message's window is not
+ the root window if DND is in progress. */
+ && (!x_dnd_in_progress
+ || !x_dnd_waiting_for_finish
+ || event->xclient.window != dpyinfo->root_window)
&& event->xclient.format == 32)
{
XEvent send_event = *event;
send_event.xclient.window = dpyinfo->root_window;
XSendEvent (dpyinfo->display, dpyinfo->root_window, False,
- /* FIXME: handling window stacking changes
- during drag-and-drop requires Emacs to
- select for SubstructureNotifyMask,
- which in turn causes the message to be
- sent to Emacs itself using the event
- mask specified by the EWMH. To avoid
- an infinite loop, just use
- SubstructureRedirectMask when a
- drag-and-drop operation is in
- progress. */
- ((x_dnd_in_progress || x_dnd_waiting_for_finish)
- ? SubstructureRedirectMask
- : SubstructureRedirectMask |
SubstructureNotifyMask),
+ SubstructureRedirectMask | SubstructureNotifyMask,
&send_event);
*finish = X_EVENT_DROP;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master fbe7ac16d7: Fix replying to _NET_WM_PING during drag-and-drop,
Po Lu <=