Skip to content

Commit 3d3b7f1

Browse files
committed
wayland/lock: avoid creating lock surfaces for the fallback screen
Fixes #61
1 parent 79b2204 commit 3d3b7f1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/wayland/session_lock.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "session_lock.hpp"
22

3+
#include <private/qwaylandscreen_p.h>
34
#include <qcolor.h>
45
#include <qcoreapplication.h>
56
#include <qguiapplication.h>
@@ -52,6 +53,17 @@ void WlSessionLock::onReload(QObject* oldInstance) {
5253
void WlSessionLock::updateSurfaces(bool show, WlSessionLock* old) {
5354
auto screens = QGuiApplication::screens();
5455

56+
screens.removeIf([](QScreen* screen) {
57+
if (dynamic_cast<QtWaylandClient::QWaylandScreen*>(screen->handle()) == nullptr) {
58+
qDebug() << "Not creating lock surface for screen" << screen
59+
<< "as it is not backed by a wayland screen.";
60+
61+
return true;
62+
}
63+
64+
return false;
65+
});
66+
5567
auto map = this->surfaces.toStdMap();
5668
for (auto& [screen, surface]: map) {
5769
if (!screens.contains(screen)) {

0 commit comments

Comments
 (0)