diff options
author | Po Lu <luangruo@yahoo.com> | 2022-09-11 16:50:16 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2022-09-11 16:50:26 +0800 |
commit | a380ce2008e944486946b0083aa58cc8161176c6 (patch) | |
tree | d889e2383f88f8224554c3fa7b0ebdad7ba477ff /src/xterm.c | |
parent | 8a902013e4d390ec077baff29f96e9fd12e2f392 (diff) | |
download | emacs-a380ce2008e944486946b0083aa58cc8161176c6.tar.gz emacs-a380ce2008e944486946b0083aa58cc8161176c6.tar.bz2 emacs-a380ce2008e944486946b0083aa58cc8161176c6.zip |
Make it easier to clear the Motif drag window for debugging
* src/xterm.c (xm_get_drag_window_1): Add comment explaining
side effect of x_special_window_exists_p.
(handle_one_xevent): Clear Motif drag window upon DestroyNotify.
In addition to debugging, it also reduces syncs necessary to
communicate via the Motif protocol after a defective/old client
sets the drag window without setting the disconnect mode.
Diffstat (limited to 'src/xterm.c')
-rw-r--r-- | src/xterm.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/xterm.c b/src/xterm.c index 4ac42a91384..12234351a32 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1971,6 +1971,10 @@ xm_get_drag_window_1 (struct x_display_info *dpyinfo) && tmp_data) { drag_window = *(Window *) tmp_data; + + /* This has the side effect of selecting for + StructureNotifyMask, meaning that we will get notifications + once it is deleted. */ rc = x_special_window_exists_p (dpyinfo, drag_window); if (!rc) @@ -20707,6 +20711,15 @@ handle_one_xevent (struct x_display_info *dpyinfo, == dpyinfo->net_supported_window) dpyinfo->net_supported_window = None; + if (event->xdestroywindow.window + == dpyinfo->motif_drag_window) + /* We get DestroyNotify events for the drag window because + x_special_window_exists_p selects for structure + notification. The drag window is not supposed to go away + but not all clients obey that requirement when setting the + drag window property. */ + dpyinfo->motif_drag_window = None; + xft_settings_event (dpyinfo, event); break; |