From f22a04171b3de82f7ed0059bc15c4084dd07161e Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Fri, 30 Aug 2024 12:16:08 +0300 Subject: [PATCH] wayland: Remove wl_touch emulation via wl_pointer It was added because Xwayland didn't support wl_touch, this is no longer relevant. --- src/wayland/seat.cpp | 29 ----------------------------- src/wayland/touch.cpp | 5 ----- src/wayland/touch_p.h | 1 - 3 files changed, 35 deletions(-) diff --git a/src/wayland/seat.cpp b/src/wayland/seat.cpp index 70cd44b9cc..592fa12c4a 100644 --- a/src/wayland/seat.cpp +++ b/src/wayland/seat.cpp @@ -1086,17 +1086,6 @@ TouchPoint *SeatInterface::notifyTouchDown(SurfaceInterface *surface, const QPoi const quint32 serial = display()->nextSerial(); d->touch->sendDown(effectiveTouchedSurface, id, serial, pos); - if (id == 0 && hasPointer() && surface) { - TouchInterfacePrivate *touchPrivate = TouchInterfacePrivate::get(d->touch.get()); - if (!touchPrivate->hasTouchesForClient(effectiveTouchedSurface->client())) { - // If the client did not bind the touch interface fall back - // to at least emulating touch through pointer events. - d->pointer->sendEnter(effectiveTouchedSurface, pos, serial); - d->pointer->sendMotion(pos); - d->pointer->sendFrame(); - } - } - auto tp = std::make_unique(serial, surface, this); auto r = tp.get(); d->globalTouch.ids[id] = std::move(tp); @@ -1132,15 +1121,6 @@ void SeatInterface::notifyTouchMotion(qint32 id, const QPointF &globalPosition) if (id == 0) { interaction->second->firstTouchPos = globalPosition; - - if (hasPointer() && itTouch->second->surface) { - TouchInterfacePrivate *touchPrivate = TouchInterfacePrivate::get(d->touch.get()); - if (!touchPrivate->hasTouchesForClient(itTouch->second->surface->client())) { - // Client did not bind touch, fall back to emulating with pointer events. - d->pointer->sendMotion(pos); - d->pointer->sendFrame(); - } - } } Q_EMIT touchMoved(id, itTouch->second->serial, globalPosition); } @@ -1165,15 +1145,6 @@ void SeatInterface::notifyTouchUp(qint32 id) auto client = itTouch->second->surface->client(); d->touch->sendUp(client, id, serial); - if (id == 0 && hasPointer() && client) { - TouchInterfacePrivate *touchPrivate = TouchInterfacePrivate::get(d->touch.get()); - if (!touchPrivate->hasTouchesForClient(client)) { - // Client did not bind touch, fall back to emulating with pointer events. - const quint32 serial = display()->nextSerial(); - d->pointer->sendButton(BTN_LEFT, PointerButtonState::Released, serial); - d->pointer->sendFrame(); - } - } auto it = d->globalTouch.focus.find(itTouch->second->surface); Q_ASSERT(it != d->globalTouch.focus.end()); diff --git a/src/wayland/touch.cpp b/src/wayland/touch.cpp index 055d3cfa9e..ae93696b09 100644 --- a/src/wayland/touch.cpp +++ b/src/wayland/touch.cpp @@ -35,11 +35,6 @@ QList TouchInterfacePrivate::touchesForClient return resourceMap().values(client->client()); } -bool TouchInterfacePrivate::hasTouchesForClient(ClientConnection *client) const -{ - return resourceMap().contains(client->client()); -} - TouchInterface::TouchInterface(SeatInterface *seat) : d(new TouchInterfacePrivate(this, seat)) { diff --git a/src/wayland/touch_p.h b/src/wayland/touch_p.h index 1c3dc3c5a6..1d2cbb52b3 100644 --- a/src/wayland/touch_p.h +++ b/src/wayland/touch_p.h @@ -23,7 +23,6 @@ public: TouchInterfacePrivate(TouchInterface *q, SeatInterface *seat); QList touchesForClient(ClientConnection *client) const; - bool hasTouchesForClient(ClientConnection *client) const; TouchInterface *q; SeatInterface *seat;