]> git.eshelyaron.com Git - emacs.git/commitdiff
Make sure touch end events aren't sent too many times
authorPo Lu <luangruo@yahoo.com>
Thu, 6 Jan 2022 11:11:56 +0000 (19:11 +0800)
committerPo Lu <luangruo@yahoo.com>
Thu, 6 Jan 2022 11:11:56 +0000 (19:11 +0800)
* src/xterm.c (handle_one_xevent): Don't send touch end events
twice if two valuators have their masks set without a change in
value.

src/xterm.c

index ff6c71283ec562a584c7486c7847299d85ed63f2..1d4c775753ce94bf6df161f496aa946ae84a391e 100644 (file)
@@ -10156,6 +10156,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
          case XI_Motion:
            {
              struct xi_device_t *device;
+             bool touch_end_event_seen = false;
 
              states = &xev->valuators;
              values = states->values;
@@ -10294,7 +10295,12 @@ handle_one_xevent (struct x_display_info *dpyinfo,
                              inev.ie.arg = Qnil;
                            }
 
-                         kbd_buffer_store_event_hold (&inev.ie, hold_quit);
+                         if (inev.ie.kind != TOUCH_END_EVENT
+                             || !touch_end_event_seen)
+                           {
+                             kbd_buffer_store_event_hold (&inev.ie, hold_quit);
+                             touch_end_event_seen = inev.ie.kind == TOUCH_END_EVENT;
+                           }
 
                          val->emacs_value = 0;
                        }