mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-17 04:53:48 -07:00
renderer: add lockdead_screen_delay (#8467)
This commit is contained in:
committed by
GitHub
parent
af83c82513
commit
0ddbd1c3a4
@@ -57,6 +57,7 @@ void CSessionLockManager::onNewSessionLock(SP<CSessionLock> pLock) {
|
||||
|
||||
m_pSessionLock = std::make_unique<SSessionLock>();
|
||||
m_pSessionLock->lock = pLock;
|
||||
m_pSessionLock->mLockTimer.reset();
|
||||
|
||||
m_pSessionLock->listeners.newSurface = pLock->events.newLockSurface.registerListener([this](std::any data) {
|
||||
auto SURFACE = std::any_cast<SP<CSessionLockSurface>>(data);
|
||||
@@ -176,3 +177,12 @@ bool CSessionLockManager::isSessionLockPresent() {
|
||||
bool CSessionLockManager::anySessionLockSurfacesPresent() {
|
||||
return m_pSessionLock && std::ranges::any_of(m_pSessionLock->vSessionLockSurfaces, [](const auto& surf) { return surf->mapped; });
|
||||
}
|
||||
|
||||
bool CSessionLockManager::shallConsiderLockMissing() {
|
||||
if (!m_pSessionLock)
|
||||
return false;
|
||||
|
||||
static auto LOCKDEAD_SCREEN_DELAY = CConfigValue<Hyprlang::INT>("misc:lockdead_screen_delay");
|
||||
|
||||
return m_pSessionLock->mLockTimer.getMillis() > *LOCKDEAD_SCREEN_DELAY;
|
||||
}
|
Reference in New Issue
Block a user