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

--ignore-scrolling does not work without jitter and on first scrolling #47

Open
astier opened this issue Apr 28, 2019 · 14 comments
Open
Labels

Comments

@astier
Copy link

astier commented Apr 28, 2019

Info

unclutter-xfixes version: 1.5
OS: Arch Linux
Window Manager: dwm 6.2

Problem

unclutter --ignore-scrolling doesn't ignore scrolling. It only works if the --jitter option is also enabled, ex. unclutter --ignore-scrolling --jitter 20. Additionally, it doesn't ignore scrolling on the very first scrolling if the mouse wasn't moved since unclutter started.

Reproduce

Without jitter

  1. Execute unclutter --ignore-scrolling
  2. Wait until cursor is hidden
  3. Scroll without moving the mouse
  4. See that the mouse is visible now

With jitter

  1. Execute unclutter --ignore-scrolling --jitter 20
  2. DO NOT move the mouse and wait until the cursor is hidden
  3. Scroll without moving the mouse
  4. See that the mouse is visible now
  5. Wait again until the mouse is hidden
  6. Scroll again without moving the mouse and see that the mouse is now still hidden as expected
@Airblader Airblader added the bug label Apr 29, 2019
@Airblader
Copy link
Owner

I can reproduce this, but the problem is that xinput2 reports raw motion events for me. I am scrolling on a touchpad, this might have to do with it. Are you scrolling on an actual mouse or a touchpad?

@astier
Copy link
Author

astier commented Apr 29, 2019

I am using a mouse. I tested it with the dwm-6.2 window manager and cinnamon.

@Airblader
Copy link
Owner

Can you apply the following patch

diff --git a/src/event.c b/src/event.c
index 19dee37..5fb0af8 100644
--- a/src/event.c
+++ b/src/event.c
@@ -71,6 +71,7 @@ static void x_check_cb(EV_P_ ev_check *w, int revents) {
             continue;
         }
 
+        DLOG("Event: %d (Raw Motion: %d)", cookie->evtype, XI_RawMotion);
         if (cookie->evtype == XI_RawButtonPress) {
             const XIRawEvent *data = (const XIRawEvent *) cookie->data;
             if (is_button_ignored(data)) {

and then run it as

make
./unclutter --debug --ignore-scrolling

Now let the pointer be hidden and scroll and post that output here.

@astier
Copy link
Author

astier commented May 1, 2019

Should I apply it on the latest commit or v1.5? Because your patch failes on 1.5

@Airblader
Copy link
Owner

Latest commit, sorry. :-)

@astier
Copy link
Author

astier commented May 1, 2019

[src/cursor.c:20] DEBUG: Hiding the cursor.
[src/event.c:74] DEBUG: Event: 17 (Raw Motion: 17)
[src/cursor.c:10] DEBUG: Showing the cursor.
[src/event.c:74] DEBUG: Event: 15 (Raw Motion: 17)

@Airblader
Copy link
Owner

Yeah, so this confirms what I saw too: xinput2 reports an event that the pointer has been moved.

Did this use to work and now broke or did you just recently start using unclutter-xfixes?

@astier
Copy link
Author

astier commented May 1, 2019

I installed it a couple days ago for the first time and had this issue right away. I definitely did not move the mouse because I was holding it in the air.

@astier
Copy link
Author

astier commented May 1, 2019

Another unrelated issue I had when I tried to build unclutter was that it failed because it could not find a2x. I had to install it by installing asciidoc. However, this might be because I have arch which has pretty much nothing pre-installed. Maybe it is already installed on other distros. But if not then you should mention it in your documentation.

@Airblader
Copy link
Owner

I definitely did not move the mouse because I was holding it in the air.

Yeah, I believe that; but it seems like the issue might be in the Xinput2 implementation (unless I'm misunderstanding something).

An easy fix would of course be to default jitter to 1, but I'm hesitant to do so because it introduces pointer queries for everyone (while I can reproduce the issue it doesn't seem to affect everyone). I might have to contact the X mailing list here.

But if not then you should mention it in your documentation.

It is listed in the DEPENDENCIES file. :-)

@astier
Copy link
Author

astier commented May 1, 2019

It is listed in the DEPENDENCIES file. :-)

Haha, my bad :)

An easy fix would of course be to default jitter to 1

Thats what I am doing. But it also shows the cursor on the very first scroll. After the first scroll it keeps the cursor hidden. Its not a big deal for me but might be of interest for you.

@Airblader
Copy link
Owner

Thats what I am doing.

Yeah, for now this should be a good enough workaround; sorry for the inconvenience. I have posted to the xorg-devel mailing list now to see if someone can shed some light on this.

But it also shows the cursor on the very first scroll.

This is probably because we haven't yet cached the cursor position. We could query it when unclutter-xfixes first starts up to avoid this. Could you open a separate issue for this, please? Thanks!

@astier
Copy link
Author

astier commented May 1, 2019

Could you open a separate issue for this, please?

#48

@Airblader
Copy link
Owner

For reference, here's my email from last year to which I unfortunately never got a response.

https://lists.x.org/archives/xorg-devel/2019-May/058157.html

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

No branches or pull requests

2 participants