mirror of
https://github.com/hyprwm/hyprlock.git
synced 2024-11-16 23:05:58 +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");
|
Debug::log(LOG, "Locking session");
|
||||||
m_sLockState.lock = ext_session_lock_manager_v1_lock(m_sWaylandState.sessionLock);
|
m_sLockState.lock = ext_session_lock_manager_v1_lock(m_sWaylandState.sessionLock);
|
||||||
ext_session_lock_v1_add_listener(m_sLockState.lock, &sessionLockListener, nullptr);
|
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() {
|
void CHyprlock::releaseSessionLock() {
|
||||||
|
@ -958,8 +961,8 @@ void CHyprlock::onLockLocked() {
|
||||||
|
|
||||||
void CHyprlock::onLockFinished() {
|
void CHyprlock::onLockFinished() {
|
||||||
Debug::log(LOG, "onLockFinished called. Seems we got yeeten. Is another lockscreen running?");
|
Debug::log(LOG, "onLockFinished called. Seems we got yeeten. Is another lockscreen running?");
|
||||||
ext_session_lock_v1_unlock_and_destroy(m_sLockState.lock);
|
g_pRenderer = nullptr;
|
||||||
m_sLockState.lock = nullptr;
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
ext_session_lock_manager_v1* CHyprlock::getSessionLockMgr() {
|
ext_session_lock_manager_v1* CHyprlock::getSessionLockMgr() {
|
||||||
|
|
Loading…
Reference in a new issue