aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-07-07 09:21:22 +0800
committerPo Lu2022-07-07 09:21:22 +0800
commit8575962d46d1f1d08836bf00cb74ccd344953bcb (patch)
tree5c062fa4c9c9dd12cb486543fdd971d06e6baccf /src
parent7ac9c22636cc2d6c56bf238ca4311924a6ee0cd0 (diff)
downloademacs-8575962d46d1f1d08836bf00cb74ccd344953bcb.tar.gz
emacs-8575962d46d1f1d08836bf00cb74ccd344953bcb.zip
Avoid excessive synchronization performing "xterm" drops
* src/xterm.c (x_dnd_do_unsupported_drop): Asynchronously catch errors around XSendEvent.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 225c45ff7cb..a21daa2dfc0 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -3860,6 +3860,7 @@ x_dnd_do_unsupported_drop (struct x_display_info *dpyinfo,
3860 event.xbutton.root = dpyinfo->root_window; 3860 event.xbutton.root = dpyinfo->root_window;
3861 event.xbutton.x_root = root_x; 3861 event.xbutton.x_root = root_x;
3862 event.xbutton.y_root = root_y; 3862 event.xbutton.y_root = root_y;
3863
3863 x_catch_errors (dpyinfo->display); 3864 x_catch_errors (dpyinfo->display);
3864 3865
3865 child = dpyinfo->root_window; 3866 child = dpyinfo->root_window;
@@ -3892,6 +3893,8 @@ x_dnd_do_unsupported_drop (struct x_display_info *dpyinfo,
3892 if (owner != FRAME_X_WINDOW (f)) 3893 if (owner != FRAME_X_WINDOW (f))
3893 goto cancel; 3894 goto cancel;
3894 3895
3896 x_uncatch_errors ();
3897
3895 event.xbutton.window = child; 3898 event.xbutton.window = child;
3896 event.xbutton.subwindow = None; 3899 event.xbutton.subwindow = None;
3897 event.xbutton.x = dest_x; 3900 event.xbutton.x = dest_x;
@@ -3905,14 +3908,20 @@ x_dnd_do_unsupported_drop (struct x_display_info *dpyinfo,
3905 event.xbutton.type = ButtonPress; 3908 event.xbutton.type = ButtonPress;
3906 event.xbutton.time = before + 1; 3909 event.xbutton.time = before + 1;
3907 3910
3911 x_ignore_errors_for_next_request (dpyinfo);
3908 XSendEvent (dpyinfo->display, child, 3912 XSendEvent (dpyinfo->display, child,
3909 True, ButtonPressMask, &event); 3913 True, ButtonPressMask, &event);
3914 x_stop_ignoring_errors (dpyinfo);
3910 3915
3911 event.xbutton.type = ButtonRelease; 3916 event.xbutton.type = ButtonRelease;
3912 event.xbutton.time = before + 2; 3917 event.xbutton.time = before + 2;
3913 3918
3919 x_ignore_errors_for_next_request (dpyinfo);
3914 XSendEvent (dpyinfo->display, child, 3920 XSendEvent (dpyinfo->display, child,
3915 True, ButtonReleaseMask, &event); 3921 True, ButtonReleaseMask, &event);
3922 x_stop_ignoring_errors (dpyinfo);
3923
3924 return;
3916 3925
3917 cancel: 3926 cancel:
3918 x_uncatch_errors (); 3927 x_uncatch_errors ();