sessionlock: fix timer logic on unsafe state
This commit is contained in:
parent
8b38353012
commit
91d8a629eb
1 changed files with 26 additions and 28 deletions
|
|
@ -91,6 +91,7 @@ void CSessionLockManager::onNewSessionLock(SP<CSessionLock> pLock) {
|
||||||
g_pCompositor->focusSurface(nullptr);
|
g_pCompositor->focusSurface(nullptr);
|
||||||
g_pSeatManager->setGrab(nullptr);
|
g_pSeatManager->setGrab(nullptr);
|
||||||
|
|
||||||
|
if (g_pCompositor->m_unsafeState) {
|
||||||
m_sessionLock->sendDeniedTimer = makeShared<CEventLoopTimer>(
|
m_sessionLock->sendDeniedTimer = makeShared<CEventLoopTimer>(
|
||||||
// Within this arbitrary amount of time, a session-lock client is expected to create and commit a lock surface for each output. If the client fails to do that, it will be denied.
|
// Within this arbitrary amount of time, a session-lock client is expected to create and commit a lock surface for each output. If the client fails to do that, it will be denied.
|
||||||
std::chrono::seconds(5),
|
std::chrono::seconds(5),
|
||||||
|
|
@ -113,13 +114,10 @@ void CSessionLockManager::onNewSessionLock(SP<CSessionLock> pLock) {
|
||||||
},
|
},
|
||||||
nullptr);
|
nullptr);
|
||||||
|
|
||||||
if (m_sessionLock->sendDeniedTimer)
|
|
||||||
g_pEventLoopManager->addTimer(m_sessionLock->sendDeniedTimer);
|
g_pEventLoopManager->addTimer(m_sessionLock->sendDeniedTimer);
|
||||||
|
} else {
|
||||||
// Normally the locked event is sent after each output rendered a lock screen frame.
|
// Normally the locked event is sent after each output rendered a lock screen frame.
|
||||||
// When there are no outputs, send it right away.
|
// When there are no outputs, send it right away.
|
||||||
if (g_pCompositor->m_unsafeState) {
|
|
||||||
removeSendDeniedTimer();
|
|
||||||
m_sessionLock->lock->sendLocked();
|
m_sessionLock->lock->sendLocked();
|
||||||
m_sessionLock->hasSentLocked = true;
|
m_sessionLock->hasSentLocked = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue