Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First scroll event is always ignored on X11 #19

Open
victornoel opened this issue Jan 7, 2022 · 8 comments
Open

First scroll event is always ignored on X11 #19

victornoel opened this issue Jan 7, 2022 · 8 comments

Comments

@victornoel
Copy link

Hi, thank you for the simple but great extension

I was wondering if it was on purpose that the first scroll event is always ignored?

Basically I move the mouse over the top panel, I scroll once, nothing happen, I scroll again, and then the workspace switches.

If it's on purpose, would there be the possibility of an option so that it directly switches without that extra scroll event?

@mrEDitor
Copy link
Owner

mrEDitor commented Jan 8, 2022

Hello and thanks for the feedback!

No, the extension should not ignore first scroll event over a panel, and it does not reproducing for me. But the scroll events system is tricky and depends on your environment configuration, such as windowing system and pointing device. I suppose there are several possible reasons of described behavior:

  1. you may be using other extensions which conflicts/races with this one for input event — you can just disable other extension to find it out;

  2. you might be misconfigured the extension with dconf or something; just open up it's settings with gnome-extensions-app and re-check vertical and horizontal scrolling settings: to "disabled" and then back to desired mode (direct/inverted);

  3. there may be some other weirdness with scroll events in your environment to check: if none of previous options helped, you can capture scrolling events on top panel with gnome looking glass (press Alt+F2, type lg, and hit the enter key) like this:

  • paste this script to log events via gnome-shell (most probably available with journalctl /usr/bin/gnome-shell):
Main.uiGroup.get_children().find(a => a.name == 'panelBox').get_children().find(a => a.name == 'panel').connect('scroll-event', (s, e) => log('scroll event', `direction: ${e.get_scroll_direction()}, delta: ${e.get_scroll_delta()}, device: ${e.get_source_device().get_device_type()}`))
  • alternatively, this one will show up events back to looking glass:
Main.uiGroup.get_children().find(a => a.name == 'panelBox').get_children().find(a => a.name == 'panel').connect('scroll-event', (s, e) => Main.lookingGlass._pushResult('scroll event', `direction: ${e.get_scroll_direction()}, delta: ${e.get_scroll_delta()}, device: ${e.get_source_device().get_device_type()}`))
  • to stop logging use:
Main.uiGroup.get_children().find(a => a.name == 'panelBox').get_children().find(a => a.name == 'panel').disconnect(r(...))

where r(...) is the result of one of previous calls, printed to looking glass.

Please, capture some scroll events (the first one, which is ignored, and then accepted ones; there may be really lot of events per scroll gesture for some devices, that's ok) and paste them here.

@mrEDitor mrEDitor added the bug label Jan 8, 2022
@victornoel
Copy link
Author

Thank you for this very detailed instructions!

In order:

  1. I tried to disable all extensions but scroll panel and even restarted gnome shell to be sure there were no leftover from improperly implemented extensions and the problem is still present
  2. I also checked the settings and all is good, I tried disable and then reenable and the problem is still present
  3. here is what I found out with the logs:

The first event ignored prints this (both events were logged for the one mouse scroll):

janv. 09 19:13:40 lasagna gnome-shell[1446]: scroll event, direction: 4, delta: 0,0, device: 0
janv. 09 19:13:40 lasagna gnome-shell[1446]: clutter_event_get_scroll_delta: assertion 'event->scroll.direction == CLUTTER_SCROLL_SMOOTH' failed
janv. 09 19:13:40 lasagna gnome-shell[1446]: scroll event, direction: 1, delta: 0,0, device: 0

Then the next 2 events are working as expected:

janv. 09 19:13:45 lasagna gnome-shell[1446]: clutter_event_get_scroll_delta: assertion 'event->scroll.direction == CLUTTER_SCROLL_SMOOTH' failed
janv. 09 19:13:45 lasagna gnome-shell[1446]: scroll event, direction: 1, delta: 0,0, device: 0
janv. 09 19:13:45 lasagna gnome-shell[1446]: clutter_event_get_scroll_delta: assertion 'event->scroll.direction == CLUTTER_SCROLL_SMOOTH' failed
janv. 09 19:13:45 lasagna gnome-shell[1446]: scroll event, direction: 0, delta: 0,0, device: 0

Note also that after the first ignored event, all subsequent events are taken into account as long as I keep my mouse on the panel. As soon as I move it away and back on it, the first even is ignored (and we get that strange extra event in the logs as above)

@mrEDitor
Copy link
Owner

mrEDitor commented Jan 9, 2022

Thank you for logs! Seems like your environment produces zero-length Clutter.SMOOTH scroll event as "first one" (like you are using touchpad or touchscreen) but only once — which is weird. May be a minor bug in Gnome Shell, but the extension should fallback to non-Clutter.SMOOTH events in this case anyway (which I have not tested properly, eh).

As a workaround, you may try to set "Switching timeout" extension setting to zero. That's not really a good solution and may be even less useful than current behaviour, but it may work if you are using only mouse (and it scrolls accurately enough) and not a touch devices within your shell.

Also, could you please provide the distro, windowing system (is it X11 or Wayland? It's mentioned in Gnome Control Center > About) and device type (mouse, I suppose) you are using?
I'll see what can I do with the bug in a spare time and it would be much simpler to test the fix in-place for me.

@jkinred
Copy link

jkinred commented Jan 9, 2022

I also see this behaviour on Fedora 35 / GNOME 41 / X11.

Selection_872

Note that panel scroll extension doesn't have this issue (but it's missing other features) so there might be some clues there.

@mrEDitor
Copy link
Owner

mrEDitor commented Jan 15, 2022

Fixed in v4.1.5, available also in extensions store.
Feel free to comments on problems, if any persisted.

@victornoel
Copy link
Author

@mrEDitor I confirm this works as expected, thanks!

@mrEDitor
Copy link
Owner

mrEDitor commented Apr 18, 2022

Fix reverted in v4.1.6, see #20 for details. Some research made me think it's all Gnome Shell X11 fault and there is no reliable solution for bubbling events in Gnome Shell on X11. Currently I'm planning to introduce a kind of X11-specific workaround to ignore specific actor subtrees events.

For now you can build 4.1.5-like behaving version for Gnome Shell 42 with X11 from workaround#19 branch.

@mrEDitor mrEDitor reopened this Apr 18, 2022
@mrEDitor mrEDitor pinned this issue Oct 1, 2022
@mrEDitor mrEDitor changed the title First scroll event is always ignored First scroll event is always ignored on X11 Oct 1, 2022
@mrEDitor
Copy link
Owner

mrEDitor commented Oct 1, 2022

Merged master to workaround#19 branch, in case anyone needs it for Gnome 43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants