diff --git a/abstract_client.cpp b/abstract_client.cpp index e77c12c739..997941464c 100644 --- a/abstract_client.cpp +++ b/abstract_client.cpp @@ -20,10 +20,12 @@ along with this program. If not, see . #include "abstract_client.h" #include "decorations/decorationpalette.h" #include "focuschain.h" +#include "outline.h" #include "screens.h" #ifdef KWIN_BUILD_TABBOX #include "tabbox.h" #endif +#include "screenedge.h" #include "tabgroup.h" #include "workspace.h" @@ -1102,4 +1104,16 @@ void AbstractClient::updateCursor() emit moveResizeCursorChanged(c); } +void AbstractClient::leaveMoveResize() +{ + workspace()->setClientIsMoving(nullptr); + setMoveResize(false); + if (ScreenEdges::self()->isDesktopSwitchingMovingClients()) + ScreenEdges::self()->reserveDesktopSwitching(false, Qt::Vertical|Qt::Horizontal); + if (isElectricBorderMaximizing()) { + outline()->hide(); + elevate(false); + } +} + } diff --git a/abstract_client.h b/abstract_client.h index ee84aaf623..c368762a41 100644 --- a/abstract_client.h +++ b/abstract_client.h @@ -696,6 +696,13 @@ protected: * Sets an appropriate cursor shape for the logical mouse position. */ void updateCursor(); + /** + * Leaves the move resize mode. + * + * Inheriting classes must invoke the base implementation which + * ensures that the internal mode is properly ended. + **/ + virtual void leaveMoveResize(); private: void handlePaletteChange(); diff --git a/client.h b/client.h index 183c787216..d21c2a79eb 100644 --- a/client.h +++ b/client.h @@ -545,7 +545,7 @@ private: void sendSyncRequest(); bool startMoveResize(); void finishMoveResize(bool cancel); - void leaveMoveResize(); + void leaveMoveResize() override; void handleMoveResize(int x, int y, int x_root, int y_root); void handleMoveResize(const QPoint &local, const QPoint &global); void startDelayedMoveResize(); diff --git a/geometry.cpp b/geometry.cpp index bf8d7b5517..c6b9c01c0c 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -2730,18 +2730,11 @@ void Client::leaveMoveResize() move_resize_has_keyboard_grab = false; xcb_ungrab_pointer(connection(), xTime()); m_moveResizeGrabWindow.reset(); - workspace()->setClientIsMoving(0); - setMoveResize(false); if (syncRequest.counter == XCB_NONE) // don't forget to sanitize since the timeout will no more fire syncRequest.isPending = false; delete syncRequest.timeout; syncRequest.timeout = NULL; - if (ScreenEdges::self()->isDesktopSwitchingMovingClients()) - ScreenEdges::self()->reserveDesktopSwitching(false, Qt::Vertical|Qt::Horizontal); - if (isElectricBorderMaximizing()) { - outline()->hide(); - elevate(false); - } + AbstractClient::leaveMoveResize(); } // This function checks if it actually makes sense to perform a restricted move/resize.