File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,13 @@ void CSessionLockManager::onNewSessionLock(SP<CSessionLock> pLock) {
8989
9090 g_pCompositor->focusSurface (nullptr );
9191 g_pSeatManager->setGrab (nullptr );
92+
93+ // Normally the locked event is sent after each output rendered a lock screen frame.
94+ // When there are no outputs, send it right away.
95+ if (g_pCompositor->m_bUnsafeState ) {
96+ m_pSessionLock->lock ->sendLocked ();
97+ m_pSessionLock->m_hasSentLocked = true ;
98+ }
9299}
93100
94101bool CSessionLockManager::isSessionLocked () {
@@ -131,8 +138,7 @@ void CSessionLockManager::onLockscreenRenderedOnMonitor(uint64_t id) {
131138 if (!m_pSessionLock || m_pSessionLock->m_hasSentLocked )
132139 return ;
133140 m_pSessionLock->m_lockedMonitors .emplace (id);
134- const auto MONITORS = g_pCompositor->m_vMonitors ;
135- const bool LOCKED = std::all_of (MONITORS.begin (), MONITORS.end (), [this ](auto m) { return m_pSessionLock->m_lockedMonitors .contains (m->ID ); });
141+ const bool LOCKED = std::ranges::all_of (g_pCompositor->m_vMonitors , [this ](auto m) { return m_pSessionLock->m_lockedMonitors .contains (m->ID ); });
136142 if (LOCKED && m_pSessionLock->lock ->good ()) {
137143 m_pSessionLock->lock ->sendLocked ();
138144 m_pSessionLock->m_hasSentLocked = true ;
You can’t perform that action at this time.
0 commit comments