aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPo Lu2022-07-03 19:48:55 +0800
committerPo Lu2022-07-03 19:49:24 +0800
commitcfee07d4dd6317bc235046b99542fa76dc676dde (patch)
tree0e6b63e57e1c3a6cc054dadab980b4ff02a9cad5
parent5a094d16e358de13d6a8caa26ec91fea85125cf8 (diff)
downloademacs-cfee07d4dd6317bc235046b99542fa76dc676dde.tar.gz
emacs-cfee07d4dd6317bc235046b99542fa76dc676dde.zip
Improve performance when rejecting XI touch event
* src/xterm.c (handle_one_xevent): Avoid sync handling simple error.
-rw-r--r--src/xterm.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 819f7fd7e49..dc7e3283a5c 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -21676,11 +21676,12 @@ handle_one_xevent (struct x_display_info *dpyinfo,
21676 21676
21677 if (!menu_bar_p && !tool_bar_p) 21677 if (!menu_bar_p && !tool_bar_p)
21678 { 21678 {
21679 x_catch_errors (dpyinfo->display);
21680
21681 if (f && device->direct_p) 21679 if (f && device->direct_p)
21682 { 21680 {
21683 *finish = X_EVENT_DROP; 21681 *finish = X_EVENT_DROP;
21682
21683 x_catch_errors (dpyinfo->display);
21684
21684 if (x_input_grab_touch_events) 21685 if (x_input_grab_touch_events)
21685 XIAllowTouchEvents (dpyinfo->display, xev->deviceid, 21686 XIAllowTouchEvents (dpyinfo->display, xev->deviceid,
21686 xev->detail, xev->event, XIAcceptTouch); 21687 xev->detail, xev->event, XIAcceptTouch);
@@ -21700,13 +21701,18 @@ handle_one_xevent (struct x_display_info *dpyinfo,
21700 if (source) 21701 if (source)
21701 inev.ie.device = source->name; 21702 inev.ie.device = source->name;
21702 } 21703 }
21704
21705 x_uncatch_errors ();
21703 } 21706 }
21704#ifndef HAVE_GTK3 21707#ifndef HAVE_GTK3
21705 else if (x_input_grab_touch_events) 21708 else if (x_input_grab_touch_events)
21706 XIAllowTouchEvents (dpyinfo->display, xev->deviceid, 21709 {
21707 xev->detail, xev->event, XIRejectTouch); 21710 x_ignore_errors_for_next_request (dpyinfo);
21711 XIAllowTouchEvents (dpyinfo->display, xev->deviceid,
21712 xev->detail, xev->event, XIRejectTouch);
21713 x_stop_ignoring_errors (dpyinfo);
21714 }
21708#endif 21715#endif
21709 x_uncatch_errors ();
21710 } 21716 }
21711 else 21717 else
21712 { 21718 {