Proposal: make "hardware_id_wacom" more generic
peter.hutterer at who-t.net
Mon May 14 00:34:06 UTC 2018
On Sat, May 12, 2018 at 09:55:59PM -0400, ferreiradaselva wrote:
> It feels a bit off that a vendor-specific event is exposed to the client.
> Why not something like:
> void (*hardware_specific_id)(void *data,
> struct zwp_tablet_tool_vX *zwp_tablet_tool_vX,
> uint32_t length,
> uint8_t *id);
> The tablet name is already exposed on the event
> zwp_tablet_v2_listener.name. Using the name provided, the client could
> decide if would care or not about the specific model.
> So, in the case o Wacom, the `length` would be `8` and the current
> `hardware_id_hi` and `hardware_id_lo` would be passed to `*model`.
in the last 10 years of working with wacom, I haven't come across
tablets using hardware serials like wacom does. an earlier version of the
tablet protocol had something similar to what you suggested but we opted for
the vendor-specific code instead. There's a high chance that whatever
another vendor comes up with doesn't work exactly the same way, so we may
end up with a generic solution that doesn't work for any use-case but
Wacom's. Plus, we've made the real use-case more complicated.
> This way, this event could be used for any other vendor (and if they don't
> have such id, the `length` would be `0`) and the client-side wouldn't
> contain vendor-specific API.
Not really. You still need vendor-specific code to interpret the data,
you're just pretending that the way you get this data is generic.
for all we know the next use-case may be a string, or an enum, or
some form of a bitmask. And if that is the case, we can just add a separate
event that handles this in a well-specified manner.
More information about the wayland-devel