From 044c9f015498dd84f59bbf23c07ac8bc04bec47f Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Fri, 8 Mar 2024 16:41:36 +0000 Subject: [PATCH] wayland: Only send artificial mouse up events for xwayland drags Seat has to handle two types of drags; ones where clients are updated through data device, and xwayland version where the drag target has mouse events sents as pointer events. A mechanism to treat them differently was introduced, but this former xwayland hack was not included. We also don't need to send frame events when in datadevice mode. This reset of pointer state breaks electron. --- src/wayland/seat.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/wayland/seat.cpp b/src/wayland/seat.cpp index e904d4341f..582dd56aa5 100644 --- a/src/wayland/seat.cpp +++ b/src/wayland/seat.cpp @@ -732,7 +732,11 @@ void SeatInterface::notifyPointerButton(quint32 button, PointerButtonState state // not our drag button - ignore return; } - d->pointer->sendButton(button, state, serial); + + SurfaceInterface *focusedSurface = focusedPointerSurface(); + if (focusedSurface && !d->dragInhibitsPointer(focusedSurface)) { + d->pointer->sendButton(button, state, serial); + } d->endDrag(); return; } @@ -746,6 +750,10 @@ void SeatInterface::notifyPointerFrame() if (!d->pointer) { return; } + SurfaceInterface *focusedSurface = focusedPointerSurface(); + if (focusedSurface && d->dragInhibitsPointer(focusedSurface)) { + return; + } d->pointer->sendFrame(); }