mirror of
https://github.com/hyprwm/hyprlock.git
synced 2024-12-22 05:19:48 +01:00
core: fix second instance of hyprlock unlocking session (#376)
* fix second instance of hyprlock unlocking session * fix segfault when lock cannot be acquired * improve ordering of display roundtrips
This commit is contained in:
parent
c5b8ad03d0
commit
210b456c15
1 changed files with 5 additions and 2 deletions
|
@ -926,6 +926,9 @@ void CHyprlock::acquireSessionLock() {
|
|||
Debug::log(LOG, "Locking session");
|
||||
m_sLockState.lock = ext_session_lock_manager_v1_lock(m_sWaylandState.sessionLock);
|
||||
ext_session_lock_v1_add_listener(m_sLockState.lock, &sessionLockListener, nullptr);
|
||||
|
||||
// wait for wayland to signal whether the session lock has been acquired
|
||||
wl_display_roundtrip(m_sWaylandState.display);
|
||||
}
|
||||
|
||||
void CHyprlock::releaseSessionLock() {
|
||||
|
@ -958,8 +961,8 @@ void CHyprlock::onLockLocked() {
|
|||
|
||||
void CHyprlock::onLockFinished() {
|
||||
Debug::log(LOG, "onLockFinished called. Seems we got yeeten. Is another lockscreen running?");
|
||||
ext_session_lock_v1_unlock_and_destroy(m_sLockState.lock);
|
||||
m_sLockState.lock = nullptr;
|
||||
g_pRenderer = nullptr;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ext_session_lock_manager_v1* CHyprlock::getSessionLockMgr() {
|
||||
|
|
Loading…
Reference in a new issue