Bug 99666 - ScrollMethod "button" time-based, not event-based
Summary: ScrollMethod "button" time-based, not event-based
Status: RESOLVED FIXED
Alias: None
Product: Wayland
Classification: Unclassified
Component: libinput (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: low minor
Assignee: Peter Hutterer
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-03 13:35 UTC by momboisse.alain
Modified: 2018-03-19 08:46 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description momboisse.alain 2017-02-03 13:35:09 UTC

    
Comment 1 momboisse.alain 2017-02-03 13:40:55 UTC
Hello

I've been playing with xev and I confirmed whet I already suspected : when using button 8 ("back") as a ScrollButton, the choice between "back" and "scroll" is time-based, not events-based.

Explanation :
 1. I press button 8 for ~100ms, then release : "back"
 2. I press button 8 for ~500ms, then release : nothing
 3. I press button 8 for ~100ms, move the pointer, then release : "back"
 4. I press button 8 for ~500ms, move the pointer, then release : scroll

IMHO cases 2 and 3 are wrong : pressing button 8, however long, without any MotionNotify event, then release, should always trigger "back" ; and pressing button 8 however shortly, if I move the pointer, should generate ButtonPress + ButtonRelease for buttons 4 and 5 and not "back"
Comment 2 momboisse.alain 2017-02-03 13:49:53 UTC
Correction : case number 3 generates "nothing", not "back" (because ButtonPress/ButtonRelease events for button 8 do not appear)

{{{

Explanation :
 1. I press button 8 for ~100ms, then release : "back"
 2. I press button 8 for ~500ms, then release : nothing
 3. I press button 8 for ~100ms, move the pointer, then release : nothing
 4. I press button 8 for ~500ms, move the pointer, then release : scroll

}}}
Comment 3 Peter Hutterer 2017-02-06 00:23:24 UTC
good point, that makes sense. that's a fairly trivial fix to make, I recommend having a look at evdev_button_scroll_button() and working your way from there. looks like all we need is an extra boolean that tells us whether we actually sent events so we know whether to filter the button press.

you can test locally with the ./tools/event-debug tool so you don't alway have to restart until it works
Comment 5 Peter Hutterer 2017-02-21 22:04:10 UTC
commit 6a2870f5ca88d20e9e5a9c668ba95154815e0d49
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Feb 20 13:32:07 2017 +1000

    evdev: add "READY" state to button scrolling
Comment 6 Andris Zeila 2018-03-19 07:58:20 UTC
I'm wondering if button scrolling could use the same logic (and code) as two-finger scrolling. The only addition would be to generate button press/release event when scroll button is realeased and scrolling is not in pogress.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.