Client: Register QPointingDevices for graphics tablet devices


Followup to 222455cd643c128fa9730c9c527a7fdcadd0acfe

Reference material: https://wayland.app/protocols/tablet-unstable-v2

It's not clear how to get the number of buttons on a stylus.

QWaylandTabletToolV2::zwp_tablet_tool_v2_removed() is called when a
stylus leaves proximity; but we avoid deleting the QWaylandTabletToolV2
instance too soon, because a proximity leave event may be in flight at
the same time, carrying a pointer to the stylus device. Instead, each
"dead" tool is deleted when another enters. The tablet protocol makes it
difficult to retain the same instances indefinitely, as we would
otherwise do: the zwp_tablet_tool_v2 is constructed elsewhere, a pointer
is given to the QWaylandTabletToolV2 ctor and retained. So a "dead" tool
may hold a dangling pointer; and at the time a new QWaylandTabletToolV2
instance is constructed, its details are not yet known, so it would not
be possible to look up and reuse an existing matching instance (as we
would otherwise probably do).

Task-number: QTBUG-72167
Task-number: QTBUG-112432
Task-number: QTBUG-115207
Pick-to: 6.8
Change-Id: I3423a0d0bd2aae5be4e61cc60da8c3362a80d10e
Reviewed-by: Liang Qi <liang.qi@qt.io>
commit5af836aea3bb91a9f388e565415dc33b2fde4577
parentdd8965bd60fa3587bc219e4638478cd9a4d95f3b
authorShawn Rutledge <shawn.rutledge@qt.io>
committerShawn Rutledge <shawn.rutledge@qt.io>
commit timeTue, 3 Sep 2024 16:40:51 +0200