Prevent move/resize event when handling set full screen event

BUG: 421232
This commit is contained in:
Benjamin Port 2020-06-29 09:03:21 +02:00 committed by Benjamin Port
parent 0ef5ddfd47
commit 2d13bc3aa8
2 changed files with 33 additions and 0 deletions

View file

@ -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)

View file

@ -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);