wayland/lock: avoid creating lock surfaces for the fallback screen

Fixes #61
This commit is contained in:
outfoxxed 2025-06-19 14:54:52 -07:00
parent 79b2204af8
commit 3d3b7f1c05
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E

View file

@ -1,5 +1,6 @@
#include "session_lock.hpp"
#include <private/qwaylandscreen_p.h>
#include <qcolor.h>
#include <qcoreapplication.h>
#include <qguiapplication.h>
@ -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<QtWaylandClient::QWaylandScreen*>(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)) {