From 1f49c55711bec6f9396458503b996079356f42c0 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Thu, 25 Apr 2024 14:18:25 -0700 Subject: [PATCH] wayland/lock: fix post-reload lockscreen creation This broke due to the changes that ensure onReload always runs. --- src/wayland/session_lock.cpp | 9 +++++---- src/wayland/session_lock.hpp | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/wayland/session_lock.cpp b/src/wayland/session_lock.cpp index 0bbfe056..ac1cf7d6 100644 --- a/src/wayland/session_lock.cpp +++ b/src/wayland/session_lock.cpp @@ -91,6 +91,7 @@ void WlSessionLock::updateSurfaces(WlSessionLock* old) { auto* oldInstance = old == nullptr ? nullptr : old->surfaces.value(screen, nullptr); instance->reload(oldInstance); + instance->attach(); this->surfaces[screen] = instance; } @@ -198,15 +199,15 @@ void WlSessionLockSurface::onReload(QObject* oldInstance) { QObject::connect(this->window, &QWindow::screenChanged, this, &WlSessionLockSurface::screenChanged); QObject::connect(this->window, &QQuickWindow::colorChanged, this, &WlSessionLockSurface::colorChanged); // clang-format on +} +void WlSessionLockSurface::attach() { if (auto* parent = qobject_cast(this->parent())) { if (!this->ext->attach(this->window, parent->manager)) { - qWarning( - ) << "Failed to attach LockWindowExtension to window. Surface will not behave correctly."; + qFatal() << "Failed to attach WlSessionLockSurface"; } } else { - qWarning( - ) << "WlSessionLockSurface parent is not a WlSessionLock. Surface will not behave correctly."; + qFatal() << "Tried to attach a WlSessionLockSurface whose parent is not a WlSessionLock"; } } diff --git a/src/wayland/session_lock.hpp b/src/wayland/session_lock.hpp index ac3df7d4..9e35cd49 100644 --- a/src/wayland/session_lock.hpp +++ b/src/wayland/session_lock.hpp @@ -153,6 +153,7 @@ public: void onReload(QObject* oldInstance) override; QQuickWindow* disownWindow(); + void attach(); void show(); [[nodiscard]] QQuickItem* contentItem() const;