wayland/lock: avoid creating lock surfaces for the fallback screen
Fixes #61
This commit is contained in:
parent
79b2204af8
commit
3d3b7f1c05
1 changed files with 12 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
#include "session_lock.hpp"
|
#include "session_lock.hpp"
|
||||||
|
|
||||||
|
#include <private/qwaylandscreen_p.h>
|
||||||
#include <qcolor.h>
|
#include <qcolor.h>
|
||||||
#include <qcoreapplication.h>
|
#include <qcoreapplication.h>
|
||||||
#include <qguiapplication.h>
|
#include <qguiapplication.h>
|
||||||
|
@ -52,6 +53,17 @@ void WlSessionLock::onReload(QObject* oldInstance) {
|
||||||
void WlSessionLock::updateSurfaces(bool show, WlSessionLock* old) {
|
void WlSessionLock::updateSurfaces(bool show, WlSessionLock* old) {
|
||||||
auto screens = QGuiApplication::screens();
|
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();
|
auto map = this->surfaces.toStdMap();
|
||||||
for (auto& [screen, surface]: map) {
|
for (auto& [screen, surface]: map) {
|
||||||
if (!screens.contains(screen)) {
|
if (!screens.contains(screen)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue