From 557843752298ff403f0e1c265abc628c3fc78608 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Sun, 6 Dec 2020 19:04:40 +0200 Subject: [PATCH] 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. --- xdgshellclient.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xdgshellclient.cpp b/xdgshellclient.cpp index 4da9d7129f..eaaa0ae5e0 100644 --- a/xdgshellclient.cpp +++ b/xdgshellclient.cpp @@ -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; }