Subject: bug#57020: 29.0.50; Mouse wheel stops working

From: Michael Heerdegen <[email-masked]>
Date: Tue, 09 Aug 2022 02:13:17 +0200

Po Lu <[email-masked]> writes:

> Hmm, thanks.  Could you also add the following instrumentation to that
> code, like such: [...]

You mean like this?

diff --git a/src/xterm.c b/src/xterm.c
index 36797bc0ab..88cd566cd3 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -20465,7 +20465,10 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 	      device = xi_device_from_id (dpyinfo, xev->deviceid);

 	      if (!device)
-		goto XI_OTHER;
+		{
+		  fprintf (stderr, "device not found, %d\n", xev->deviceid);
+		  goto XI_OTHER;
+		}

 #ifdef HAVE_XINPUT2_2
 	      if (xev->flags & XIPointerEmulated)
--
2.30.2

No, I got no output after the mouse wheel had stopped working.

But I have a new data point: there seems to be a relation with switching
to the X session of a different user.  I sometimes have several X
sessions running a the same time.  Some minutes ago the wheel had
stopped working.  I switched to the X session at C-M-f2 and then back to
here (i.e. C-M-f1) and the mouse wheel started to work again.

I'm not saying that there is a connection between the failure and other
X sessions, however.  AFAIR, when the mouse wheel stopped working
yesterday there was only one X session running.  Maybe closing the
laptop (suspend to RAM) sometimes triggers this, but that's just
guessing.  That switching X sessions healed the issue didn't seem
incidental, however.  I had the feeling that I should try that, and I
had been using the mouse wheel as first action after switching the X
session back.

But I had been playing stuntrally with the joystick before I noticed the
mouse wheel stopped working.  Maybe plugging in the Joystick is related
again....dunno if that guessing helps you, if not, I'm sorry for the
noise.

Michael.