From e77bc92b99e06ee66ccd684afbfe3a743af1f01d Mon Sep 17 00:00:00 2001 From: Maximilian Seidler <78690852+PaideiaDilemma@users.noreply.github.com> Date: Sat, 25 Jan 2025 20:43:21 +0000 Subject: [PATCH] core: don't attempt to unlock when we are not locked yet (#661) --- src/core/hyprlock.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/hyprlock.cpp b/src/core/hyprlock.cpp index 1adbc02..3a75ea6 100644 --- a/src/core/hyprlock.cpp +++ b/src/core/hyprlock.cpp @@ -518,6 +518,11 @@ void CHyprlock::run() { } void CHyprlock::unlock() { + if (!m_bLocked) { + Debug::log(WARN, "Unlock called, but not locked yet. This can happen when dpms is off during the grace period."); + return; + } + const bool IMMEDIATE = m_sCurrentDesktop != "Hyprland"; g_pRenderer->startFadeOut(true, IMMEDIATE);