Skip to content

Commit 1f49c55

Browse files
committed
wayland/lock: fix post-reload lockscreen creation
This broke due to the changes that ensure onReload always runs.
1 parent ce4e697 commit 1f49c55

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/wayland/session_lock.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ void WlSessionLock::updateSurfaces(WlSessionLock* old) {
9191

9292
auto* oldInstance = old == nullptr ? nullptr : old->surfaces.value(screen, nullptr);
9393
instance->reload(oldInstance);
94+
instance->attach();
9495

9596
this->surfaces[screen] = instance;
9697
}
@@ -198,15 +199,15 @@ void WlSessionLockSurface::onReload(QObject* oldInstance) {
198199
QObject::connect(this->window, &QWindow::screenChanged, this, &WlSessionLockSurface::screenChanged);
199200
QObject::connect(this->window, &QQuickWindow::colorChanged, this, &WlSessionLockSurface::colorChanged);
200201
// clang-format on
202+
}
201203

204+
void WlSessionLockSurface::attach() {
202205
if (auto* parent = qobject_cast<WlSessionLock*>(this->parent())) {
203206
if (!this->ext->attach(this->window, parent->manager)) {
204-
qWarning(
205-
) << "Failed to attach LockWindowExtension to window. Surface will not behave correctly.";
207+
qFatal() << "Failed to attach WlSessionLockSurface";
206208
}
207209
} else {
208-
qWarning(
209-
) << "WlSessionLockSurface parent is not a WlSessionLock. Surface will not behave correctly.";
210+
qFatal() << "Tried to attach a WlSessionLockSurface whose parent is not a WlSessionLock";
210211
}
211212
}
212213

src/wayland/session_lock.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ class WlSessionLockSurface: public Reloadable {
153153
void onReload(QObject* oldInstance) override;
154154
QQuickWindow* disownWindow();
155155

156+
void attach();
156157
void show();
157158

158159
[[nodiscard]] QQuickItem* contentItem() const;

0 commit comments

Comments
 (0)