wayland: Update pointer state before ending the drag

ending a drag will update focus. Kwin explicitly resets it to whatever
is now under the mouse now that the implicit grab has ended.

This means no-one sends a pointer up.

Clients (xwayland) don't automatically make leave events count as a
mouse up, because typically you don't get a leave event whilst we have a
grab.

Xwayland also can't track the status of the wl_datasource as it didn't
use it.

This patch shouldn't affect any wayland clients as we don't send a frame event
until the focus changes which is after the dnd_finished events.

BUG: 465444

Testing done:
 - dragged firefox under xwayland tabs out from firefox to the desktop
 - confirmed a new window appeared
master
David Edmundson 1 year ago
parent 78643b958f
commit 023fc220a1

@ -272,7 +272,8 @@ void TestDragAndDrop::testPointerDragAndDrop()
// verify that we did not get any further input events
QVERIFY(pointerMotionSpy.isEmpty());
QCOMPARE(buttonPressSpy.count(), 1);
// the release event is sent primarily for xwayland
QCOMPARE(buttonPressSpy.count(), 2);
}
void TestDragAndDrop::testTouchDragAndDrop()
@ -530,8 +531,9 @@ void TestDragAndDrop::testPointerEventsIgnored()
QCOMPARE(axisSpy.count(), 1);
QCOMPARE(pointerMotionSpy.count(), 1);
QCOMPARE(pointerEnteredSpy.count(), 1);
QCOMPARE(buttonSpy.count(), 1);
QVERIFY(pointerLeftSpy.isEmpty());
// the release event is sent primary for xwayland, see BUG 465444
QCOMPARE(buttonSpy.count(), 2);
}
QTEST_GUILESS_MAIN(TestDragAndDrop)

@ -714,6 +714,7 @@ void SeatInterface::notifyPointerButton(quint32 button, PointerButtonState state
// not our drag button - ignore
return;
}
d->pointer->sendButton(button, state, serial);
d->endDrag();
return;
}

Loading…
Cancel
Save