diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-04-29 17:42:07 +0100 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-04-29 17:50:07 +0100 |
| commit | f2b03e9679bc1a091fecffd98b50a4179b5c7d43 (patch) | |
| tree | c86033d3436b0354db17e9209633ac7a6594631f /src/managers/input/IdleInhibitor.cpp | |
| parent | 86133983a94a6ad52933e0577b6098dd8e98ed8c (diff) | |
ext-idle-notify: move to new impl
Diffstat (limited to 'src/managers/input/IdleInhibitor.cpp')
| -rw-r--r-- | src/managers/input/IdleInhibitor.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/managers/input/IdleInhibitor.cpp b/src/managers/input/IdleInhibitor.cpp index 6ec5fc81..40c8c637 100644 --- a/src/managers/input/IdleInhibitor.cpp +++ b/src/managers/input/IdleInhibitor.cpp @@ -1,6 +1,7 @@ #include "InputManager.hpp" #include "../../Compositor.hpp" #include "../../protocols/IdleInhibit.hpp" +#include "../../protocols/IdleNotify.hpp" void CInputManager::newIdleInhibitor(std::any inhibitor) { const auto PINHIBIT = m_vIdleInhibitors.emplace_back(std::make_unique<SIdleInhibitor>()).get(); @@ -29,11 +30,11 @@ void CInputManager::newIdleInhibitor(std::any inhibitor) { void CInputManager::recheckIdleInhibitorStatus() { for (auto& ii : m_vIdleInhibitors) { - if (ii->pWindow.expired()) { - g_pCompositor->setIdleActivityInhibit(false); - return; - } else if (g_pHyprRenderer->shouldRenderWindow(ii->pWindow.lock())) { - g_pCompositor->setIdleActivityInhibit(false); + if (ii->pWindow.expired()) + continue; + + if (g_pHyprRenderer->shouldRenderWindow(ii->pWindow.lock())) { + PROTO::idle->setInhibit(true); return; } } @@ -44,21 +45,21 @@ void CInputManager::recheckIdleInhibitorStatus() { continue; if (w->m_eIdleInhibitMode == IDLEINHIBIT_ALWAYS) { - g_pCompositor->setIdleActivityInhibit(false); + PROTO::idle->setInhibit(true); return; } if (w->m_eIdleInhibitMode == IDLEINHIBIT_FOCUS && g_pCompositor->isWindowActive(w)) { - g_pCompositor->setIdleActivityInhibit(false); + PROTO::idle->setInhibit(true); return; } if (w->m_eIdleInhibitMode == IDLEINHIBIT_FULLSCREEN && w->m_bIsFullscreen && g_pCompositor->isWorkspaceVisible(w->m_pWorkspace)) { - g_pCompositor->setIdleActivityInhibit(false); + PROTO::idle->setInhibit(true); return; } } - g_pCompositor->setIdleActivityInhibit(true); + PROTO::idle->setInhibit(false); return; } |
