emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 05705454d5: Don't transfer window attributes trying to find the X


From: Po Lu
Subject: master 05705454d5: Don't transfer window attributes trying to find the XM drag window
Date: Fri, 22 Apr 2022 07:44:49 -0400 (EDT)

branch: master
commit 05705454d5c616cb54294ae3bbb2d40ab72fc8ed
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Don't transfer window attributes trying to find the XM drag window
    
    * src/xterm.c (xm_get_drag_window): Select for impossible event
    mask instead of asking for the window attributes.
---
 src/xterm.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index adfe3059d1..7e8d226fb2 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -1385,7 +1385,6 @@ xm_get_drag_window (struct x_display_info *dpyinfo)
   unsigned char *tmp_data = NULL;
   Window drag_window;
   XSetWindowAttributes attrs;
-  XWindowAttributes wattrs;
   Display *temp_display;
   void *old_handler;
 
@@ -1403,8 +1402,10 @@ xm_get_drag_window (struct x_display_info *dpyinfo)
        {
          drag_window = *(Window *) tmp_data;
          x_catch_errors (dpyinfo->display);
-         XGetWindowAttributes (dpyinfo->display,
-                               drag_window, &wattrs);
+         /* We use ButtonPressMask since it's one of the events an
+            input-only window can never get.  */
+         XSelectInput (dpyinfo->display, drag_window,
+                       ButtonPressMask);
          rc = !x_had_errors_p (dpyinfo->display);
          x_uncatch_errors_after_check ();
 
@@ -1474,8 +1475,10 @@ xm_get_drag_window (struct x_display_info *dpyinfo)
         current display, and the XOpenDisplay above didn't
         accidentally connect to some other display.  */
       x_catch_errors (dpyinfo->display);
-      XGetWindowAttributes (dpyinfo->display,
-                           drag_window, &wattrs);
+      /* We use ButtonPressMask since it's one of the events an
+        input-only window can never get.  */
+      XSelectInput (dpyinfo->display, drag_window,
+                   ButtonPressMask);
       rc = !x_had_errors_p (dpyinfo->display);
       x_uncatch_errors_after_check ();
       unblock_input ();



reply via email to

[Prev in Thread] Current Thread [Next in Thread]