emacs-diffs
[Top][All Lists]
Advanced

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

master cfee07d4dd: Improve performance when rejecting XI touch event


From: Po Lu
Subject: master cfee07d4dd: Improve performance when rejecting XI touch event
Date: Sun, 3 Jul 2022 07:49:34 -0400 (EDT)

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

    Improve performance when rejecting XI touch event
    
    * src/xterm.c (handle_one_xevent): Avoid sync handling simple
    error.
---
 src/xterm.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index 819f7fd7e4..dc7e3283a5 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -21676,11 +21676,12 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 
              if (!menu_bar_p && !tool_bar_p)
                {
-                 x_catch_errors (dpyinfo->display);
-
                  if (f && device->direct_p)
                    {
                      *finish = X_EVENT_DROP;
+
+                     x_catch_errors (dpyinfo->display);
+
                      if (x_input_grab_touch_events)
                        XIAllowTouchEvents (dpyinfo->display, xev->deviceid,
                                            xev->detail, xev->event, 
XIAcceptTouch);
@@ -21700,13 +21701,18 @@ handle_one_xevent (struct x_display_info *dpyinfo,
                          if (source)
                            inev.ie.device = source->name;
                        }
+
+                     x_uncatch_errors ();
                    }
 #ifndef HAVE_GTK3
                  else if (x_input_grab_touch_events)
-                   XIAllowTouchEvents (dpyinfo->display, xev->deviceid,
-                                       xev->detail, xev->event, XIRejectTouch);
+                   {
+                     x_ignore_errors_for_next_request (dpyinfo);
+                     XIAllowTouchEvents (dpyinfo->display, xev->deviceid,
+                                         xev->detail, xev->event, 
XIRejectTouch);
+                     x_stop_ignoring_errors (dpyinfo);
+                   }
 #endif
-                 x_uncatch_errors ();
                }
              else
                {



reply via email to

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