From 3d3b7f1c05b0dca2fef889e7ef7cedbee5e01592 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Thu, 19 Jun 2025 14:54:52 -0700 Subject: [PATCH] wayland/lock: avoid creating lock surfaces for the fallback screen Fixes #61 --- src/wayland/session_lock.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/wayland/session_lock.cpp b/src/wayland/session_lock.cpp index 5f0bb673..ccba9bc6 100644 --- a/src/wayland/session_lock.cpp +++ b/src/wayland/session_lock.cpp @@ -1,5 +1,6 @@ #include "session_lock.hpp" +#include #include #include #include @@ -52,6 +53,17 @@ void WlSessionLock::onReload(QObject* oldInstance) { void WlSessionLock::updateSurfaces(bool show, WlSessionLock* old) { auto screens = QGuiApplication::screens(); + screens.removeIf([](QScreen* screen) { + if (dynamic_cast(screen->handle()) == nullptr) { + qDebug() << "Not creating lock surface for screen" << screen + << "as it is not backed by a wayland screen."; + + return true; + } + + return false; + }); + auto map = this->surfaces.toStdMap(); for (auto& [screen, surface]: map) { if (!screens.contains(screen)) {