Commit 84b8d866 authored by Benjamin Port's avatar Benjamin Port Committed by Benjamin Port
Browse files

Prevent move/resize event when handling a maximize event

parent 2d13bc3a
......@@ -81,6 +81,7 @@ private Q_SLOTS:
void testDestroyMoveClient();
void testDestroyResizeClient();
void testSetFullScreenWhenMoving();
void testSetMaximizeWhenMoving();
private:
KWayland::Client::ConnectionThread *m_connection = nullptr;
......@@ -1125,15 +1126,35 @@ void MoveResizeWindowTest::testSetFullScreenWhenMoving()
auto client = Test::renderAndWaitForShown(surface.data(), QSize(500, 800), Qt::blue);
QVERIFY(client);
// The client should receive a configure event upon becoming active.
QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested);
QVERIFY(configureRequestedSpy.isValid());
QVERIFY(configureRequestedSpy.wait());
workspace()->slotWindowMove();
QCOMPARE(client->isMove(), true);
client->setFullScreen(true);
QCOMPARE(client->isFullScreen(), true);
QCOMPARE(client->isMove(), false);
QCOMPARE(workspace()->moveResizeClient(), nullptr);
// Let's pretend that the client crashed.
shellSurface.reset();
surface.reset();
QVERIFY(Test::waitForWindowDestroyed(client));
}
void MoveResizeWindowTest::testSetMaximizeWhenMoving()
{
// Ensure we disable moving event when changeMaximize is triggered
using namespace KWayland::Client;
QScopedPointer<Surface> surface(Test::createSurface());
QVERIFY(!surface.isNull());
QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data()));
QVERIFY(!shellSurface.isNull());
// let's render
auto client = Test::renderAndWaitForShown(surface.data(), QSize(500, 800), Qt::blue);
QVERIFY(client);
workspace()->slotWindowMove();
QCOMPARE(client->isMove(), true);
client->setMaximize(true, true);
QCOMPARE(client->isMove(), false);
QCOMPARE(workspace()->moveResizeClient(), nullptr);
// Let's pretend that the client crashed.
......
......@@ -1757,6 +1757,7 @@ void XdgToplevelClient::changeMaximize(bool horizontal, bool vertical, bool adju
}
StackingUpdatesBlocker blocker(workspace());
dontMoveResize();
// call into decoration update borders
if (isDecorated() && decoration()->client() && !(options->borderlessMaximizedWindows() && m_requestedMaximizeMode == KWin::MaximizeFull)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment