diff --git a/autotests/mock_abstract_client.cpp b/autotests/mock_abstract_client.cpp index 20795fa899..d270f636e1 100644 --- a/autotests/mock_abstract_client.cpp +++ b/autotests/mock_abstract_client.cpp @@ -30,6 +30,7 @@ AbstractClient::AbstractClient(QObject *parent) , m_hiddenInternal(false) , m_keepBelow(false) , m_geometry() + , m_resize(false) { } @@ -103,4 +104,14 @@ void AbstractClient::setKeepBelow(bool keepBelow) emit keepBelowChanged(); } +bool AbstractClient::isResize() const +{ + return m_resize; +} + +void AbstractClient::setResize(bool set) +{ + m_resize = set; +} + } diff --git a/autotests/mock_abstract_client.h b/autotests/mock_abstract_client.h index a88f04f06b..8d7e825d75 100644 --- a/autotests/mock_abstract_client.h +++ b/autotests/mock_abstract_client.h @@ -47,6 +47,8 @@ public: void setHiddenInternal(bool set); void setGeometry(const QRect &rect); void setKeepBelow(bool); + bool isResize() const; + void setResize(bool set); virtual void showOnScreenEdge() = 0; Q_SIGNALS: @@ -60,6 +62,7 @@ private: bool m_hiddenInternal; bool m_keepBelow; QRect m_geometry; + bool m_resize; }; } diff --git a/autotests/mock_client.cpp b/autotests/mock_client.cpp index 97d7e0154f..88b5fa6698 100644 --- a/autotests/mock_client.cpp +++ b/autotests/mock_client.cpp @@ -35,9 +35,4 @@ void Client::showOnScreenEdge() setHiddenInternal(false); } -bool Client::isResize() const -{ - return false; -} - } diff --git a/autotests/mock_client.h b/autotests/mock_client.h index df62ecd62d..17db3c8c7b 100644 --- a/autotests/mock_client.h +++ b/autotests/mock_client.h @@ -34,8 +34,6 @@ class Client : public AbstractClient public: explicit Client(QObject *parent); virtual ~Client(); - - bool isResize() const; void showOnScreenEdge() override; }; diff --git a/autotests/test_screen_edges.cpp b/autotests/test_screen_edges.cpp index e26459e5c2..8411781044 100644 --- a/autotests/test_screen_edges.cpp +++ b/autotests/test_screen_edges.cpp @@ -392,6 +392,27 @@ void TestScreenEdges::testCreatingInitialEdges() QCOMPARE(e->activatesForTouchGesture(), false); QCOMPARE(e->approachGeometry(), expectedGeometries.at(i*2+1)); } + + // let's start a move of window. + Client client(workspace()); + workspace()->setMovingClient(&client); + for (int i = 0; i < 8; ++i) { + auto e = edges.at(i); + QVERIFY(!e->isReserved()); + QCOMPARE(e->activatesForPointer(), true); + QCOMPARE(e->activatesForTouchGesture(), false); + QCOMPARE(e->approachGeometry(), expectedGeometries.at(i*2+1)); + } + // not for resize + client.setResize(true); + for (int i = 0; i < 8; ++i) { + auto e = edges.at(i); + QVERIFY(!e->isReserved()); + QCOMPARE(e->activatesForPointer(), false); + QCOMPARE(e->activatesForTouchGesture(), false); + QCOMPARE(e->approachGeometry(), expectedGeometries.at(i*2+1)); + } + workspace()->setMovingClient(nullptr); } void TestScreenEdges::testCallback() diff --git a/screenedge.cpp b/screenedge.cpp index 589c1d03f2..7e4fc07212 100644 --- a/screenedge.cpp +++ b/screenedge.cpp @@ -183,6 +183,12 @@ bool Edge::activatesForPointer() const if (m_edges->isDesktopSwitching()) { return true; } + if (m_edges->isDesktopSwitchingMovingClients()) { + auto c = Workspace::self()->getMovingClient(); + if (c && !c->isResize()) { + return true; + } + } if (!m_callBacks.isEmpty()) { return true; }