Commit 2d13bc3a authored by Benjamin Port's avatar Benjamin Port Committed by Benjamin Port
Browse files

Prevent move/resize event when handling set full screen event

BUG: 421232
parent 0ef5ddfd
......@@ -80,6 +80,7 @@ private Q_SLOTS:
void testResizeForVirtualKeyboardWithFullScreen();
void testDestroyMoveClient();
void testDestroyResizeClient();
void testSetFullScreenWhenMoving();
private:
KWayland::Client::ConnectionThread *m_connection = nullptr;
......@@ -1109,6 +1110,37 @@ void MoveResizeWindowTest::testDestroyResizeClient()
QCOMPARE(workspace()->moveResizeClient(), nullptr);
}
void MoveResizeWindowTest::testSetFullScreenWhenMoving()
{
// Ensure we disable moving event when setFullScreen 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);
// 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));
}
}
WAYLANDTEST_MAIN(KWin::MoveResizeWindowTest)
......
......@@ -1695,6 +1695,7 @@ void XdgToplevelClient::setFullScreen(bool set, bool user)
}
StackingUpdatesBlocker blocker1(workspace());
GeometryUpdatesBlocker blocker2(this);
dontMoveResize();
workspace()->updateClientLayer(this); // active fullscreens get different layer
updateDecoration(false, false);
......
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