[PATCH 27/27] Input: Add smooth-scrolling support to GetPointerEvents

Daniel Stone daniel at fooishbar.org
Mon Jun 6 04:20:21 PDT 2011


Hi,

On Sun, Jun 05, 2011 at 08:49:43PM +0200, Simon Thum wrote:
> On 06/03/2011 05:00 PM, Daniel Stone wrote:
> > For scroll wheel support, we used to send buttons 4/5 and 6/7 for
> > horizontal/vertical positive/negative scroll events.  For touchpads, we
> > really want more fine-grained scroll values.  GetPointerEvents now
> > accepts both old-school scroll button presses, and new-style scroll axis
> > events, while emitting both types of events to support both old and new
> > clients.
> 
> I guess apps that want the best support across server generations are
> supposed to know they can ignore legacy scroll by virtue of the
> POINTER_EMULATED flag? If yes, shouldn't the flag be always set on
> either the axis updates or the button events?

Yeah -- there's a missing inputproto part that I'll send out with the
second round of patches.  Here's the applicable text:
     PointerEmulated means that the event has been emulated from another
     XI 2.x event for legacy client support, and that this event should
     be ignored if the client listens for these events.  This flag will
     be set on scroll ButtonPress events (buttons 4, 5, 6 and 7) if a
     smooth-scrolling event on the Rel Vert Scroll or Rel Horiz Scroll
     axis events was also generated.

You'll note that the GetPointerEvents helper does indeed always set
POINTER_EMULATED on buttons 4, 5, 6 and 7.

> I further guess that the non-raw scroll events will still be adding up,
> is that intentional?

Crap, good catch.  Guess that's what you get for playing around with
smooth scrolling and a bunch of accel changes at the same time ... I'll
probably have to fix that by adding a new axis mode, I guess (relative
but not additive).

Cheers,
Daniel


More information about the xorg-devel mailing list