Subject: bug#65129: 30.0.50; pinch gestures suddenly stops being recognised

From: Po Lu <[email-masked]>
Date: Tue, 08 Aug 2023 08:59:02 +0800

Visuwesh <[email-masked]> writes:

> Unfortunately, I don't have a good reproducer for this but ever since
> updating to master from the emacs-29 branch, pinch gestures in Emacs
> frames suddenly stops being recognised.  When I do C-h k and pinch, or
> view lossage, I see wheel-left and wheel-down events but no pinch event.
>
> However, if I create a new frame and try to pinch there, it works just
> fine.
>
> I apologise again for the vague report, but I have nothing better to
> offer.  So far, I haven't tried to reproduce this in an emacs -Q
> session.

No worries there, please instrument handle_one_xevent like so:

diff --git a/src/xterm.c b/src/xterm.c
index f454733c659..57b06c571f6 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -24722,6 +24722,11 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 	      x_display_set_last_user_time (dpyinfo, pev->time,
 					    pev->send_event, true);
 
+	      if (device)
+		fprintf (stderr, "XI_GesturePinchBegin: %d\n", device->use);
+	      else
+		fprintf (stderr, "XI_GesturePinchBegin: no device\n");
+
 	      if (!device || device->use != XIMasterPointer)
 		goto XI_OTHER;
 
and show us what is printed when you attempt a pinch gesture after they
cease being delivered.