From d1760ed1f31c02a95b37a9bf4084129c829ebe7f Mon Sep 17 00:00:00 2001 From: Aditya Alok Date: Tue, 5 May 2026 22:42:03 +0530 Subject: [PATCH] wayland/lock: add window null check in surface isVisible --- changelog/next.md | 1 + src/wayland/session_lock.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog/next.md b/changelog/next.md index 5a6954c..aaeaf1c 100644 --- a/changelog/next.md +++ b/changelog/next.md @@ -1,3 +1,4 @@ ## Bug Fixes - Fixed ScreencopyView not displaying when only lock surfaces are shown. +- Fixed WlSessionLockSurface.visible crashing if accessed before backing surface creation. diff --git a/src/wayland/session_lock.cpp b/src/wayland/session_lock.cpp index 95f6ccf..3b908b8 100644 --- a/src/wayland/session_lock.cpp +++ b/src/wayland/session_lock.cpp @@ -274,7 +274,10 @@ void WlSessionLockSurface::show() { QQuickItem* WlSessionLockSurface::contentItem() const { return this->mContentItem; } -bool WlSessionLockSurface::isVisible() const { return this->window->isVisible(); } +bool WlSessionLockSurface::isVisible() const { + if (this->window == nullptr) return false; + return this->window->isVisible(); +} qint32 WlSessionLockSurface::width() const { if (this->window == nullptr) return 0;