Skip to content

Commit eb63207

Browse files
core: make attemptRestoreOnDeath faster and hyprland exclusive (#506)
* core: make attemptRestoreOnDeath hyprland exclusive * core: destoy lock and sessionLockSurfaces in attemptRestoreOnDeath
1 parent d9c2a5e commit eb63207

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/core/hyprlock.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,7 @@ zwlr_screencopy_manager_v1* CHyprlock::getScreencopy() {
11381138
}
11391139

11401140
void CHyprlock::attemptRestoreOnDeath() {
1141-
if (m_bTerminate)
1141+
if (m_bTerminate || m_sCurrentDesktop != "Hyprland")
11421142
return;
11431143

11441144
const auto XDG_RUNTIME_DIR = getenv("XDG_RUNTIME_DIR");
@@ -1176,6 +1176,13 @@ void CHyprlock::attemptRestoreOnDeath() {
11761176
ofs << timeNowMs;
11771177
ofs.close();
11781178

1179+
if (m_bLocked && m_sLockState.lock) {
1180+
ext_session_lock_v1_destroy(m_sLockState.lock);
1181+
1182+
// Destroy sessionLockSurfaces
1183+
m_vOutputs.clear();
1184+
}
1185+
11791186
spawnSync("hyprctl keyword misc:allow_session_lock_restore true");
1180-
spawnAsync("sleep 2 && hyprlock --immediate --immediate-render & disown");
1187+
spawnSync("hyprctl dispatch exec \"hyprlock --immediate --immediate-render\"");
11811188
}

0 commit comments

Comments
 (0)