emacs-diffs
[Top][All Lists]
Advanced

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

master 8575962d46: Avoid excessive synchronization performing "xterm" dr


From: Po Lu
Subject: master 8575962d46: Avoid excessive synchronization performing "xterm" drops
Date: Wed, 6 Jul 2022 21:21:34 -0400 (EDT)

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

    Avoid excessive synchronization performing "xterm" drops
    
    * src/xterm.c (x_dnd_do_unsupported_drop): Asynchronously catch
    errors around XSendEvent.
---
 src/xterm.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/xterm.c b/src/xterm.c
index 225c45ff7c..a21daa2dfc 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -3860,6 +3860,7 @@ x_dnd_do_unsupported_drop (struct x_display_info *dpyinfo,
   event.xbutton.root = dpyinfo->root_window;
   event.xbutton.x_root = root_x;
   event.xbutton.y_root = root_y;
+
   x_catch_errors (dpyinfo->display);
 
   child = dpyinfo->root_window;
@@ -3892,6 +3893,8 @@ x_dnd_do_unsupported_drop (struct x_display_info *dpyinfo,
   if (owner != FRAME_X_WINDOW (f))
     goto cancel;
 
+  x_uncatch_errors ();
+
   event.xbutton.window = child;
   event.xbutton.subwindow = None;
   event.xbutton.x = dest_x;
@@ -3905,14 +3908,20 @@ x_dnd_do_unsupported_drop (struct x_display_info 
*dpyinfo,
   event.xbutton.type = ButtonPress;
   event.xbutton.time = before + 1;
 
+  x_ignore_errors_for_next_request (dpyinfo);
   XSendEvent (dpyinfo->display, child,
              True, ButtonPressMask, &event);
+  x_stop_ignoring_errors (dpyinfo);
 
   event.xbutton.type = ButtonRelease;
   event.xbutton.time = before + 2;
 
+  x_ignore_errors_for_next_request (dpyinfo);
   XSendEvent (dpyinfo->display, child,
              True, ButtonReleaseMask, &event);
+  x_stop_ignoring_errors (dpyinfo);
+
+  return;
 
  cancel:
   x_uncatch_errors ();



reply via email to

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