Provide leaveMoveResize() as virtual method in AbstractClient

The non X11 specific code is split out into a base implementation
which is called from the Client.
remotes/origin/Plasma/5.5
Martin Gräßlin 11 years ago
parent 88e097ec16
commit 1c40e809ea
  1. 14
      abstract_client.cpp
  2. 7
      abstract_client.h
  3. 2
      client.h
  4. 9
      geometry.cpp

@ -20,10 +20,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "abstract_client.h" #include "abstract_client.h"
#include "decorations/decorationpalette.h" #include "decorations/decorationpalette.h"
#include "focuschain.h" #include "focuschain.h"
#include "outline.h"
#include "screens.h" #include "screens.h"
#ifdef KWIN_BUILD_TABBOX #ifdef KWIN_BUILD_TABBOX
#include "tabbox.h" #include "tabbox.h"
#endif #endif
#include "screenedge.h"
#include "tabgroup.h" #include "tabgroup.h"
#include "workspace.h" #include "workspace.h"
@ -1102,4 +1104,16 @@ void AbstractClient::updateCursor()
emit moveResizeCursorChanged(c); 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);
}
}
} }

@ -696,6 +696,13 @@ protected:
* Sets an appropriate cursor shape for the logical mouse position. * Sets an appropriate cursor shape for the logical mouse position.
*/ */
void updateCursor(); 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: private:
void handlePaletteChange(); void handlePaletteChange();

@ -545,7 +545,7 @@ private:
void sendSyncRequest(); void sendSyncRequest();
bool startMoveResize(); bool startMoveResize();
void finishMoveResize(bool cancel); void finishMoveResize(bool cancel);
void leaveMoveResize(); void leaveMoveResize() override;
void handleMoveResize(int x, int y, int x_root, int y_root); void handleMoveResize(int x, int y, int x_root, int y_root);
void handleMoveResize(const QPoint &local, const QPoint &global); void handleMoveResize(const QPoint &local, const QPoint &global);
void startDelayedMoveResize(); void startDelayedMoveResize();

@ -2730,18 +2730,11 @@ void Client::leaveMoveResize()
move_resize_has_keyboard_grab = false; move_resize_has_keyboard_grab = false;
xcb_ungrab_pointer(connection(), xTime()); xcb_ungrab_pointer(connection(), xTime());
m_moveResizeGrabWindow.reset(); 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 if (syncRequest.counter == XCB_NONE) // don't forget to sanitize since the timeout will no more fire
syncRequest.isPending = false; syncRequest.isPending = false;
delete syncRequest.timeout; delete syncRequest.timeout;
syncRequest.timeout = NULL; syncRequest.timeout = NULL;
if (ScreenEdges::self()->isDesktopSwitchingMovingClients()) AbstractClient::leaveMoveResize();
ScreenEdges::self()->reserveDesktopSwitching(false, Qt::Vertical|Qt::Horizontal);
if (isElectricBorderMaximizing()) {
outline()->hide();
elevate(false);
}
} }
// This function checks if it actually makes sense to perform a restricted move/resize. // This function checks if it actually makes sense to perform a restricted move/resize.

Loading…
Cancel
Save