diff options
Diffstat (limited to 'src/client/qwaylandtabletv2.cpp')
-rw-r--r-- | src/client/qwaylandtabletv2.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/client/qwaylandtabletv2.cpp b/src/client/qwaylandtabletv2.cpp index 8a0544aeb..73524c166 100644 --- a/src/client/qwaylandtabletv2.cpp +++ b/src/client/qwaylandtabletv2.cpp @@ -20,6 +20,11 @@ QWaylandTabletManagerV2::QWaylandTabletManagerV2(QWaylandDisplay *display, uint createTabletSeat(seat); } +QWaylandTabletManagerV2::~QWaylandTabletManagerV2() +{ + destroy(); +} + QWaylandTabletSeatV2 *QWaylandTabletManagerV2::createTabletSeat(QWaylandInputDevice *seat) { return new QWaylandTabletSeatV2(this, seat); @@ -27,6 +32,7 @@ QWaylandTabletSeatV2 *QWaylandTabletManagerV2::createTabletSeat(QWaylandInputDev QWaylandTabletSeatV2::QWaylandTabletSeatV2(QWaylandTabletManagerV2 *manager, QWaylandInputDevice *seat) : QtWayland::zwp_tablet_seat_v2(manager->get_tablet_seat(seat->wl_seat())) + , m_seat(seat) { } @@ -38,6 +44,9 @@ QWaylandTabletSeatV2::~QWaylandTabletSeatV2() tool->destroy(); for (auto *pad : m_pads) pad->destroy(); + qDeleteAll(m_tablets); + qDeleteAll(m_tools); + qDeleteAll(m_pads); destroy(); } @@ -50,7 +59,7 @@ void QWaylandTabletSeatV2::zwp_tablet_seat_v2_tablet_added(zwp_tablet_v2 *id) void QWaylandTabletSeatV2::zwp_tablet_seat_v2_tool_added(zwp_tablet_tool_v2 *id) { - auto *tool = new QWaylandTabletToolV2(id); + auto *tool = new QWaylandTabletToolV2(this, id); m_tools.push_back(tool); connect(tool, &QWaylandTabletToolV2::destroyed, this, [this, tool] { m_tools.removeOne(tool); }); } @@ -73,8 +82,9 @@ void QWaylandTabletV2::zwp_tablet_v2_removed() delete this; } -QWaylandTabletToolV2::QWaylandTabletToolV2(::zwp_tablet_tool_v2 *tool) +QWaylandTabletToolV2::QWaylandTabletToolV2(QWaylandTabletSeatV2 *tabletSeat, ::zwp_tablet_tool_v2 *tool) : QtWayland::zwp_tablet_tool_v2(tool) + , m_tabletSeat(tabletSeat) { } @@ -160,8 +170,14 @@ void QWaylandTabletToolV2::zwp_tablet_tool_v2_proximity_out() void QWaylandTabletToolV2::zwp_tablet_tool_v2_down(uint32_t serial) { - Q_UNUSED(serial); m_pending.down = true; + + if (m_pending.proximitySurface) { + if (QWaylandWindow *window = m_pending.proximitySurface->waylandWindow()) { + QWaylandInputDevice *seat = m_tabletSeat->seat(); + seat->display()->setLastInputDevice(seat, serial, window); + } + } } void QWaylandTabletToolV2::zwp_tablet_tool_v2_up() |