Prevent move/resize event when handling set full screen event
BUG: 421232
This commit is contained in:
parent
0ef5ddfd47
commit
2d13bc3aa8
2 changed files with 33 additions and 0 deletions
|
@ -80,6 +80,7 @@ private Q_SLOTS:
|
||||||
void testResizeForVirtualKeyboardWithFullScreen();
|
void testResizeForVirtualKeyboardWithFullScreen();
|
||||||
void testDestroyMoveClient();
|
void testDestroyMoveClient();
|
||||||
void testDestroyResizeClient();
|
void testDestroyResizeClient();
|
||||||
|
void testSetFullScreenWhenMoving();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
KWayland::Client::ConnectionThread *m_connection = nullptr;
|
KWayland::Client::ConnectionThread *m_connection = nullptr;
|
||||||
|
@ -1109,6 +1110,37 @@ void MoveResizeWindowTest::testDestroyResizeClient()
|
||||||
QCOMPARE(workspace()->moveResizeClient(), nullptr);
|
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)
|
WAYLANDTEST_MAIN(KWin::MoveResizeWindowTest)
|
||||||
|
|
|
@ -1695,6 +1695,7 @@ void XdgToplevelClient::setFullScreen(bool set, bool user)
|
||||||
}
|
}
|
||||||
StackingUpdatesBlocker blocker1(workspace());
|
StackingUpdatesBlocker blocker1(workspace());
|
||||||
GeometryUpdatesBlocker blocker2(this);
|
GeometryUpdatesBlocker blocker2(this);
|
||||||
|
dontMoveResize();
|
||||||
|
|
||||||
workspace()->updateClientLayer(this); // active fullscreens get different layer
|
workspace()->updateClientLayer(this); // active fullscreens get different layer
|
||||||
updateDecoration(false, false);
|
updateDecoration(false, false);
|
||||||
|
|
Loading…
Reference in a new issue