diff --git a/src/abstract_client.cpp b/src/abstract_client.cpp index 51d9fd4dc4..774a97147c 100644 --- a/src/abstract_client.cpp +++ b/src/abstract_client.cpp @@ -1430,25 +1430,25 @@ void AbstractClient::handleInteractiveMoveResize(int x, int y, int x_root, int y if (!update) return; - if (isInteractiveResize() && !haveResizeEffect()) { - doInteractiveResizeSync(); - } else - performInteractiveMoveResize(); + if (isInteractiveMove()) { + move(moveResizeGeometry().topLeft()); + completeInteractiveMoveResizeStep(); + } else { + if (!haveResizeEffect()) { + doInteractiveResizeSync(); + } else { + completeInteractiveMoveResizeStep(); + } + } if (isInteractiveMove()) { ScreenEdges::self()->check(globalPos, QDateTime::fromMSecsSinceEpoch(xTime(), Qt::UTC)); } } -void AbstractClient::performInteractiveMoveResize() +void AbstractClient::completeInteractiveMoveResizeStep() { - const QRect &moveResizeGeom = moveResizeGeometry(); - if (isInteractiveMove()) { - move(moveResizeGeom.topLeft()); - } else if (isInteractiveResize() && !haveResizeEffect()) { - resize(moveResizeGeom.size()); - } - Q_EMIT clientStepUserMovedResized(this, moveResizeGeom); + Q_EMIT clientStepUserMovedResized(this, moveResizeGeometry()); } StrutRect AbstractClient::strutRect(StrutArea area) const diff --git a/src/abstract_client.h b/src/abstract_client.h index 433d39a680..54032c2e3f 100644 --- a/src/abstract_client.h +++ b/src/abstract_client.h @@ -1158,7 +1158,7 @@ protected: * ensures that the internal mode is properly ended. */ virtual void leaveInteractiveMoveResize(); - void performInteractiveMoveResize(); + void completeInteractiveMoveResizeStep(); /* * Checks if the mouse cursor is near the edge of the screen and if so * activates quick tiling or maximization diff --git a/src/internal_client.cpp b/src/internal_client.cpp index 48f5ef07cc..dd044b2080 100644 --- a/src/internal_client.cpp +++ b/src/internal_client.cpp @@ -404,7 +404,7 @@ void InternalClient::present(const QSharedPointer fbo) surfaceItem()->addDamage(surfaceItem()->rect()); if (isInteractiveResize()) { - performInteractiveMoveResize(); + completeInteractiveMoveResizeStep(); } } @@ -423,7 +423,7 @@ void InternalClient::present(const QImage &image, const QRegion &damage) surfaceItem()->addDamage(damage); if (isInteractiveResize()) { - performInteractiveMoveResize(); + completeInteractiveMoveResizeStep(); } } diff --git a/src/x11client.cpp b/src/x11client.cpp index 257543d6e8..0095234756 100644 --- a/src/x11client.cpp +++ b/src/x11client.cpp @@ -2772,12 +2772,20 @@ void X11Client::handleSync() if (m_syncRequest.timeout) { m_syncRequest.timeout->stop(); } - performInteractiveMoveResize(); + performInteractiveResize(); updateWindowPixmap(); } else // setReadyForPainting does as well, but there's a small chance for resize syncs after the resize ended addRepaintFull(); } +void X11Client::performInteractiveResize() +{ + if (isInteractiveResize() && !haveResizeEffect()) { + resize(moveResizeGeometry().size()); + } + completeInteractiveMoveResizeStep(); +} + bool X11Client::belongToSameApplication(const X11Client *c1, const X11Client *c2, SameApplicationChecks checks) { bool same_app = false; @@ -4583,7 +4591,7 @@ void X11Client::handleSyncTimeout() if (m_syncRequest.counter == XCB_NONE) { // client w/o XSYNC support. allow the next resize event m_syncRequest.isPending = false; // NEVER do this for clients with a valid counter } // (leads to sync request races in some clients) - performInteractiveMoveResize(); + performInteractiveResize(); } NETExtendedStrut X11Client::strut() const diff --git a/src/x11client.h b/src/x11client.h index 3d58683140..9892e4642f 100644 --- a/src/x11client.h +++ b/src/x11client.h @@ -396,6 +396,7 @@ private: void getSyncCounter(); void sendSyncRequest(); void leaveInteractiveMoveResize() override; + void performInteractiveResize(); void establishCommandWindowGrab(uint8_t button); void establishCommandAllGrab(uint8_t button); void resizeDecoration(); diff --git a/src/xdgshellclient.cpp b/src/xdgshellclient.cpp index d23367c6b8..d5d2f1c95e 100644 --- a/src/xdgshellclient.cpp +++ b/src/xdgshellclient.cpp @@ -245,7 +245,7 @@ void XdgSurfaceClient::handleNextWindowGeometry() updateGeometry(frameGeometry); if (isInteractiveResize()) { - performInteractiveMoveResize(); + completeInteractiveMoveResizeStep(); } }