wayland/lock: check for protocol availability before use

Fixes #66
This commit is contained in:
outfoxxed 2025-06-20 16:37:22 -07:00
parent 362c8e1b69
commit c17ea54371
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
3 changed files with 11 additions and 0 deletions

View file

@ -109,6 +109,13 @@ void WlSessionLock::updateSurfaces(bool show, WlSessionLock* old) {
void WlSessionLock::realizeLockTarget(WlSessionLock* old) {
if (this->lockTarget) {
if (!SessionLockManager::lockAvailable()) {
qCritical() << "Cannot start session lock: The current compositor does not support the "
"ext-session-lock-v1 protocol.";
this->unlock();
return;
}
if (this->mSurfaceComponent == nullptr) {
qWarning() << "WlSessionLock.surface is null. Aborting lock.";
this->unlock();