unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#57020: 29.0.50; Mouse wheel stops working
@ 2022-08-06 22:53 Michael Heerdegen
  2022-08-07  1:56 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Heerdegen @ 2022-08-06 22:53 UTC (permalink / raw)
  To: 57020


Hello,

I have been seeing this for a while now (maybe two weeks or a bit more,
not sure when it started exactly):

After starting Emacs everything is good.  But after a while, the mouse
wheel stops working.  That is, mouse-4 and mouse-5, with and without
modifiers, are not recognized.  In all buffers and windows, scroll-bar,
mode line, everywhere.  C-h k shows nothing because no event is
registered.

When that happens the mouse wheel still works normally in other X
windows or the window manager or in a newly started Emacs session.

This is under X and Openbox.

TIA,

Michael.


In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)
 of 2022-08-06 built on drachen
Repository revision: fe801e359f71f12843c8d0ce545473815840dc89
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Debian GNU/Linux 11 (bullseye)

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LCMS2 LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP
SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XINPUT2
XPM GTK3 ZLIB






^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#57020: 29.0.50; Mouse wheel stops working
  2022-08-06 22:53 bug#57020: 29.0.50; Mouse wheel stops working Michael Heerdegen
@ 2022-08-07  1:56 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-08-07  2:07   ` Michael Heerdegen
  0 siblings, 1 reply; 12+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-08-07  1:56 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 57020

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Hello,
>
> I have been seeing this for a while now (maybe two weeks or a bit more,
> not sure when it started exactly):
>
> After starting Emacs everything is good.  But after a while, the mouse
> wheel stops working.  That is, mouse-4 and mouse-5, with and without
> modifiers, are not recognized.  In all buffers and windows, scroll-bar,
> mode line, everywhere.  C-h k shows nothing because no event is
> registered.
>
> When that happens the mouse wheel still works normally in other X
> windows or the window manager or in a newly started Emacs session.
>
> This is under X and Openbox.

mouse-4/mouse-5 or wheel-up/wheel-down?

Please be clear here, since they are handled separately under XInput 2.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#57020: 29.0.50; Mouse wheel stops working
  2022-08-07  1:56 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-08-07  2:07   ` Michael Heerdegen
  2022-08-07  2:47     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Heerdegen @ 2022-08-07  2:07 UTC (permalink / raw)
  To: Po Lu; +Cc: 57020

Po Lu <luangruo@yahoo.com> writes:

> mouse-4/mouse-5 or wheel-up/wheel-down?
>
> Please be clear here, since they are handled separately under XInput
> 2.

You are right, the force of habit: When the events are considered they
are named "wheel-up/wheel-down" - I'm sorry.

Michael.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#57020: 29.0.50; Mouse wheel stops working
  2022-08-07  2:07   ` Michael Heerdegen
@ 2022-08-07  2:47     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-08-08  1:58       ` Michael Heerdegen
  0 siblings, 1 reply; 12+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-08-07  2:47 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 57020

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Po Lu <luangruo@yahoo.com> writes:
>
>> mouse-4/mouse-5 or wheel-up/wheel-down?
>>
>> Please be clear here, since they are handled separately under XInput
>> 2.
>
> You are right, the force of habit: When the events are considered they
> are named "wheel-up/wheel-down" - I'm sorry.
>
> Michael.

Could you instrument this chunk of xterm.c:

		      /* See the comment on top of x_cache_xi_devices
			 for more details on how scroll wheel movement
			 is reported on XInput 2.  */
		      delta = x_get_scroll_valuator_delta (dpyinfo, device,
							   i, *values, &val);
		      values++;

by adding:

		      printf ("%g\n", delta);

afterwards?  Then, please see if any (and what) values are printed once
the mouse wheel stops working.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#57020: 29.0.50; Mouse wheel stops working
  2022-08-07  2:47     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-08-08  1:58       ` Michael Heerdegen
  2022-08-08  2:36         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Heerdegen @ 2022-08-08  1:58 UTC (permalink / raw)
  To: Po Lu; +Cc: 57020

Po Lu <luangruo@yahoo.com> writes:

> 		      printf ("%g\n", delta);
>
> afterwards?  Then, please see if any (and what) values are printed once
> the mouse wheel stops working.

Short answer: nothing is printed.

Before the issue starts happening, I see -1 and +1 for each wheel
"click" and lots of 1.79769e+308 values when moving the mouse.

Once scrolling stopped working, mouse wheel turning leads to no output
any more (but the 1.79769e+308 values are still printed).

What I was also noticing: when turning the mouse wheel over the scroll
bar, there is a visual feedback: it looks like the scroll bar would lead
to a scroll (the bar moves), but scrolling is not happening, the buffer
text stands still.  Also that is happening without output for DELTA.

Michael.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#57020: 29.0.50; Mouse wheel stops working
  2022-08-08  1:58       ` Michael Heerdegen
@ 2022-08-08  2:36         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-08-09  0:13           ` Michael Heerdegen
  0 siblings, 1 reply; 12+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-08-08  2:36 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 57020

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Po Lu <luangruo@yahoo.com> writes:
>
>> 		      printf ("%g\n", delta);
>>
>> afterwards?  Then, please see if any (and what) values are printed once
>> the mouse wheel stops working.
>
> Short answer: nothing is printed.
>
> Before the issue starts happening, I see -1 and +1 for each wheel
> "click" and lots of 1.79769e+308 values when moving the mouse.
>
> Once scrolling stopped working, mouse wheel turning leads to no output
> any more (but the 1.79769e+308 values are still printed).
>
> What I was also noticing: when turning the mouse wheel over the scroll
> bar, there is a visual feedback: it looks like the scroll bar would lead
> to a scroll (the bar moves), but scrolling is not happening, the buffer
> text stands still.  Also that is happening without output for DELTA.
>
> Michael.

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

	      device = xi_device_from_id (dpyinfo, xev->deviceid);

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

and see if that is ever printed when wheel movement stops working?





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#57020: 29.0.50; Mouse wheel stops working
  2022-08-08  2:36         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-08-09  0:13           ` Michael Heerdegen
  2022-08-09  0:24             ` Michael Heerdegen
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Heerdegen @ 2022-08-09  0:13 UTC (permalink / raw)
  To: Po Lu; +Cc: 57020

[-- Attachment #1: Type: text/plain, Size: 157 bytes --]

Po Lu <luangruo@yahoo.com> writes:


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

You mean like this?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Instrument-xterm.c.patch --]
[-- Type: text/x-diff, Size: 480 bytes --]

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


[-- Attachment #3: Type: text/plain, Size: 1127 bytes --]


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.

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* bug#57020: 29.0.50; Mouse wheel stops working
  2022-08-09  0:13           ` Michael Heerdegen
@ 2022-08-09  0:24             ` Michael Heerdegen
  2022-08-09  0:48               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Heerdegen @ 2022-08-09  0:24 UTC (permalink / raw)
  To: Po Lu; +Cc: 57020

Michael Heerdegen <michael_heerdegen@web.de> writes:

> again....dunno if that guessing helps you, if not, I'm sorry for the
> noise.

I tested it a bit, and it's really that simple: plugging in or out the
Joystick reliably breaks the mouse wheel in Emacs, and C-M-f2 and back
reliably unbreaks it (this time there was only the tty2 Linux console,
no second X session).

HTH,

Michael.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#57020: 29.0.50; Mouse wheel stops working
  2022-08-09  0:24             ` Michael Heerdegen
@ 2022-08-09  0:48               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-08-09  3:07                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 12+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-08-09  0:48 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 57020

Michael Heerdegen <michael_heerdegen@web.de> writes:

> I tested it a bit, and it's really that simple: plugging in or out the
> Joystick reliably breaks the mouse wheel in Emacs, and C-M-f2 and back
> reliably unbreaks it (this time there was only the tty2 Linux console,
> no second X session).

Hmm, very odd.  I will try to figure out why this is, thanks.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#57020: 29.0.50; Mouse wheel stops working
  2022-08-09  0:48               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-08-09  3:07                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-08-09  3:48                   ` Michael Heerdegen
  0 siblings, 1 reply; 12+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-08-09  3:07 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 57020

Po Lu <luangruo@yahoo.com> writes:

> Hmm, very odd.  I will try to figure out why this is, thanks.

Should be fixed now.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#57020: 29.0.50; Mouse wheel stops working
  2022-08-09  3:07                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-08-09  3:48                   ` Michael Heerdegen
  2022-08-09  5:11                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Heerdegen @ 2022-08-09  3:48 UTC (permalink / raw)
  To: Po Lu; +Cc: 57020

Po Lu <luangruo@yahoo.com> writes:

> > Hmm, very odd.  I will try to figure out why this is, thanks.
>
> Should be fixed now.

Indeed, thank you very much!

I quickly tested the recipe with the joystick, and it works as expected
now.  No new problems as well (but I tested only one minute so far).

Thanks again,

Michael.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#57020: 29.0.50; Mouse wheel stops working
  2022-08-09  3:48                   ` Michael Heerdegen
@ 2022-08-09  5:11                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 12+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-08-09  5:11 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 57020-done

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Indeed, thank you very much!
>
> I quickly tested the recipe with the joystick, and it works as expected
> now.  No new problems as well (but I tested only one minute so far).
>
> Thanks again,
>
> Michael.

Any time, thanks for testing.  I'm closing this bug.





^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-08-09  5:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-06 22:53 bug#57020: 29.0.50; Mouse wheel stops working Michael Heerdegen
2022-08-07  1:56 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-07  2:07   ` Michael Heerdegen
2022-08-07  2:47     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-08  1:58       ` Michael Heerdegen
2022-08-08  2:36         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-09  0:13           ` Michael Heerdegen
2022-08-09  0:24             ` Michael Heerdegen
2022-08-09  0:48               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-09  3:07                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-09  3:48                   ` Michael Heerdegen
2022-08-09  5:11                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).