[RFC v2 wayland-protocols] tablet: define our own enum for tablet tool buttons

Peter Hutterer peter.hutterer at who-t.net
Wed Nov 23 00:49:46 UTC 2016


On Tue, Nov 22, 2016 at 09:03:52AM -0800, Ping Cheng wrote:
> On Tuesday, November 22, 2016, Daniel Stone <daniel at fooishbar.org> wrote:
> 
> > Hey,
> >
> > On 21 November 2016 at 23:13, Peter Hutterer <peter.hutterer at who-t.net
> > <javascript:;>> wrote:
> > > On Mon, Nov 21, 2016 at 12:42:36PM +0000, Daniel Stone wrote:
> > >> Concretely though, reusing BTN_* codes where possible would make it
> > >> easier for clients to transition between the two.
> > >
> > > I disagree here. The kernel only has BTN_STYLUS and BTN_STYLUS2, after
> > that
> > > we overlap with DOUBLETAP range and later buttons that are completely
> > > different (e.g. BTN_GEAR_DOWN). I think this would only make it worse.
> > > This protocol is still unstable, every client needs updates once we mark
> > it
> > > stable anyway, making the enums *values* mean something is
> > counterproductive
> > > IMO.
> >
> > Shrug, once in an enum they're totally arbitrary values (so which
> > BTN_* they overlap doesn't make a difference), and it does make it a
> > little harder to screw it up, as well as easier to stay compatible
> 
> 
> I see pros and cons for both suggestions. I was into Peter's idea of
> generic numbering since it is easier to implement and
> offers some flexibility for client to decide how to translate those events.
> 
> However, I am kinda convinced by Daniel's point now. If the BTN_ has a
> preferred default action/feature, kernel should report that information to
> userland. Client should translate that default setting accordingly.

I'm not sure I understand your point here. The only change would be that
compositors need to have a switch statement to convert from BTN_STYLUS
into the wayland enum. Beyond that, no conversation should be done.

The benefit Daniel mentions would be that clients don't have to be switched
over immediately because the ABI stays the same for BTN_STYLUS(2) and
BTN_LEFT-RIGHT.

Cheers,
   Peter

> 
> That's just my 2 cents. It's still your call, Peter ;-).
> 
> Cheers,
> Ping
> 
> between multiple versions. But, your call.
> >
> > Cheers,
> > Daniel
> >


More information about the wayland-devel mailing list