mirror of
https://github.com/hyprwm/hyprlock.git
synced 2024-11-16 23:05:58 +01:00
core: make attemptRestoreOnDeath faster and hyprland exclusive (#506)
* core: make attemptRestoreOnDeath hyprland exclusive * core: destoy lock and sessionLockSurfaces in attemptRestoreOnDeath
This commit is contained in:
parent
d9c2a5e0b7
commit
eb63207ef0
1 changed files with 9 additions and 2 deletions
|
@ -1138,7 +1138,7 @@ zwlr_screencopy_manager_v1* CHyprlock::getScreencopy() {
|
|||
}
|
||||
|
||||
void CHyprlock::attemptRestoreOnDeath() {
|
||||
if (m_bTerminate)
|
||||
if (m_bTerminate || m_sCurrentDesktop != "Hyprland")
|
||||
return;
|
||||
|
||||
const auto XDG_RUNTIME_DIR = getenv("XDG_RUNTIME_DIR");
|
||||
|
@ -1176,6 +1176,13 @@ void CHyprlock::attemptRestoreOnDeath() {
|
|||
ofs << timeNowMs;
|
||||
ofs.close();
|
||||
|
||||
spawnSync("hyprctl keyword misc:allow_session_lock_restore true");
|
||||
spawnAsync("sleep 2 && hyprlock --immediate --immediate-render & disown");
|
||||
if (m_bLocked && m_sLockState.lock) {
|
||||
ext_session_lock_v1_destroy(m_sLockState.lock);
|
||||
|
||||
// Destroy sessionLockSurfaces
|
||||
m_vOutputs.clear();
|
||||
}
|
||||
|
||||
spawnSync("hyprctl keyword misc:allow_session_lock_restore true");
|
||||
spawnSync("hyprctl dispatch exec \"hyprlock --immediate --immediate-render\"");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue