From 5d09eaae1ff20887f20e48bbf91fcdb35cd20669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sun, 3 May 2015 14:26:18 +0200 Subject: [PATCH] do not switch desktop on resizing windows REVIEW: 123599 --- autotests/mock_client.cpp | 5 +++++ autotests/mock_client.h | 1 + screenedge.cpp | 5 +++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/autotests/mock_client.cpp b/autotests/mock_client.cpp index bdd17371d0..f5625dc112 100644 --- a/autotests/mock_client.cpp +++ b/autotests/mock_client.cpp @@ -85,6 +85,11 @@ void Client::setHiddenInternal(bool set) m_hiddenInternal = set; } +bool Client::isResize() const +{ + return false; +} + void Client::setGeometry(const QRect &rect) { m_geometry = rect; diff --git a/autotests/mock_client.h b/autotests/mock_client.h index ee267ffba1..63528ed726 100644 --- a/autotests/mock_client.h +++ b/autotests/mock_client.h @@ -38,6 +38,7 @@ public: bool isActive() const; bool isFullScreen() const; bool isHiddenInternal() const; + bool isResize() const; QRect geometry() const; void setActive(bool active); diff --git a/screenedge.cpp b/screenedge.cpp index 7f45d762f2..6ab6186bed 100644 --- a/screenedge.cpp +++ b/screenedge.cpp @@ -188,7 +188,8 @@ void Edge::handle(const QPoint &cursorPos) unreserve(); return; } - if ((edges()->isDesktopSwitchingMovingClients() && Workspace::self()->getMovingClient()) || + Client *movingClient = Workspace::self()->getMovingClient(); + if ((edges()->isDesktopSwitchingMovingClients() && movingClient && !movingClient->isResize()) || (edges()->isDesktopSwitching() && isScreenEdge())) { // always switch desktops in case: // moving a Client and option for switch on client move is enabled @@ -196,7 +197,7 @@ void Edge::handle(const QPoint &cursorPos) switchDesktop(cursorPos); return; } - if (Workspace::self()->getMovingClient()) { + if (movingClient) { // if we are moving a window we don't want to trigger the actions. This just results in // problems, e.g. Desktop Grid activated or screen locker activated which just cannot // work as we hold a grab.