From b407128caeb551ae808cf8d0fb653a252a271709 Mon Sep 17 00:00:00 2001 From: Maximilian Seidler <78690852+PaideiaDilemma@users.noreply.github.com> Date: Thu, 11 Jul 2024 16:15:32 +0200 Subject: [PATCH] core: handle ext_session_lock_v1::finished as defined in the protocol (#418) --- src/core/hyprlock.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/core/hyprlock.cpp b/src/core/hyprlock.cpp index 1114f87..9359ce0 100644 --- a/src/core/hyprlock.cpp +++ b/src/core/hyprlock.cpp @@ -959,8 +959,15 @@ void CHyprlock::onLockLocked() { void CHyprlock::onLockFinished() { Debug::log(LOG, "onLockFinished called. Seems we got yeeten. Is another lockscreen running?"); - g_pRenderer = nullptr; - exit(1); + if (m_bLocked) + // The `finished` event specifies that whenever the `locked` event has been recieved and the compositor sends `finished`, + // `unlock_and_destroy` should be called by the client. + // This does not mean the session gets unlocked! That is ultimatly the responsiblity of the compositor. + ext_session_lock_v1_unlock_and_destroy(m_sLockState.lock); + else + ext_session_lock_v1_destroy(m_sLockState.lock); + + m_bTerminate = true; } ext_session_lock_manager_v1* CHyprlock::getSessionLockMgr() {