diff --git a/abstract_client.cpp b/abstract_client.cpp --- a/abstract_client.cpp +++ b/abstract_client.cpp @@ -274,6 +274,8 @@ // Since the desktop is also activated, nothing should be in the ActiveLayer, though if (isInternal()) return UnmanagedLayer; + if (isLockScreen()) + return UnmanagedLayer; if (isDesktop()) return workspace()->showingDesktop() ? AboveLayer : DesktopLayer; if (isSplash()) // no damn annoying splashscreens diff --git a/autotests/integration/lockscreen.cpp b/autotests/integration/lockscreen.cpp --- a/autotests/integration/lockscreen.cpp +++ b/autotests/integration/lockscreen.cpp @@ -61,6 +61,7 @@ void initTestCase(); void init(); void cleanup(); + void testStackingOrder(); void testPointer(); void testPointerButton(); void testPointerAxis(); @@ -221,6 +222,24 @@ Test::destroyWaylandConnection(); } +void LockScreenTest::testStackingOrder() +{ + // This test verifies that the lockscreen greeter is placed above other windows. + + QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded); + QVERIFY(clientAddedSpy.isValid()); + + LOCK + QVERIFY(clientAddedSpy.wait()); + + AbstractClient *client = clientAddedSpy.first().first().value(); + QVERIFY(client); + QVERIFY(client->isLockScreen()); + QCOMPARE(client->layer(), UnmanagedLayer); + + UNLOCK +} + void LockScreenTest::testPointer() { using namespace KWayland::Client;