wayland: Check serials in move and resize requests

If a move or a resize request is processed after the button is released,
the window will be stuck in the move/resize mode.

This change prevents that kind of race condition by adding relevant serial
checks in the move and the resize request handlers.
This commit is contained in:
Vlad Zahorodnii 2020-12-06 19:04:40 +02:00
parent 4dba1da7c7
commit 5578437522

View file

@ -971,15 +971,17 @@ void XdgToplevelClient::handleWindowMenuRequested(SeatInterface *seat, const QPo
void XdgToplevelClient::handleMoveRequested(SeatInterface *seat, quint32 serial)
{
Q_UNUSED(seat)
Q_UNUSED(serial)
if (!seat->hasImplicitPointerGrab(serial) && !seat->hasImplicitTouchGrab(serial)) {
return;
}
performMouseCommand(Options::MouseMove, Cursors::self()->mouse()->pos());
}
void XdgToplevelClient::handleResizeRequested(SeatInterface *seat, Qt::Edges edges, quint32 serial)
{
Q_UNUSED(seat)
Q_UNUSED(serial)
if (!seat->hasImplicitPointerGrab(serial) && !seat->hasImplicitTouchGrab(serial)) {
return;
}
if (!isResizable() || isShade()) {
return;
}