emacs-diffs
[Top][All Lists]
Advanced

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

master fe6f1dfeb4: Fix error during DND from both Emacs and GTK at the s


From: Po Lu
Subject: master fe6f1dfeb4: Fix error during DND from both Emacs and GTK at the same time
Date: Sat, 4 Jun 2022 08:01:47 -0400 (EDT)

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

    Fix error during DND from both Emacs and GTK at the same time
    
    * src/xterm.c (x_dnd_get_target_window): Make mapping and
    releasing the COW atomic.  This is to fix a rare bug when
    MPX (multi-pointer X) is in use and the user tries to drag
    from both GTK and Emacs at the same time using multiple seats.
---
 src/xterm.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/xterm.c b/src/xterm.c
index edfb89070f..34a40da548 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -3524,10 +3524,13 @@ x_dnd_get_target_window (struct x_display_info *dpyinfo,
                                  dpyinfo->Xatom_NET_WM_CM_Sn) != None)
            {
              x_catch_errors (dpyinfo->display);
+             XGrabServer (dpyinfo->display);
              overlay_window = XCompositeGetOverlayWindow (dpyinfo->display,
                                                           
dpyinfo->root_window);
              XCompositeReleaseOverlayWindow (dpyinfo->display,
                                              dpyinfo->root_window);
+             XUngrabServer (dpyinfo->display);
+
              if (!x_had_errors_p (dpyinfo->display))
                {
                  XGetWindowAttributes (dpyinfo->display, overlay_window, 
&attrs);
@@ -3682,10 +3685,13 @@ x_dnd_get_target_window (struct x_display_info *dpyinfo,
                              dpyinfo->Xatom_NET_WM_CM_Sn) != None)
        {
          x_catch_errors (dpyinfo->display);
+         XGrabServer (dpyinfo->display);
          overlay_window = XCompositeGetOverlayWindow (dpyinfo->display,
                                                       dpyinfo->root_window);
          XCompositeReleaseOverlayWindow (dpyinfo->display,
                                          dpyinfo->root_window);
+         XUngrabServer (dpyinfo->display);
+
          if (!x_had_errors_p (dpyinfo->display))
            {
              XGetWindowAttributes (dpyinfo->display, overlay_window, &attrs);



reply via email to

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