diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-10-31 12:26:07 +0000 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-10-31 12:26:07 +0000 |
| commit | a69fd21a1ac90c24cee659595d62329f8638d632 (patch) | |
| tree | c1c1302b9a732f52607df7c0c6f43525caf3a9f9 /src/managers/input/IdleInhibitor.cpp | |
| parent | b6e33830af1a89a2cfbef446de1fc37e8a2b40e3 (diff) | |
Add an idleinhibit windowrule
Diffstat (limited to 'src/managers/input/IdleInhibitor.cpp')
| -rw-r--r-- | src/managers/input/IdleInhibitor.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/managers/input/IdleInhibitor.cpp b/src/managers/input/IdleInhibitor.cpp index 3efb40c6..8c0a3267 100644 --- a/src/managers/input/IdleInhibitor.cpp +++ b/src/managers/input/IdleInhibitor.cpp @@ -49,6 +49,27 @@ void CInputManager::recheckIdleInhibitorStatus() { } } + // check manual user-set inhibitors + for (auto& w : g_pCompositor->m_vWindows) { + if (w->m_eIdleInhibitMode == IDLEINHIBIT_NONE) + continue; + + if (w->m_eIdleInhibitMode == IDLEINHIBIT_ALWAYS) { + wlr_idle_set_enabled(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sSeat.seat, false); + return; + } + + if (w->m_eIdleInhibitMode == IDLEINHIBIT_FOCUS && g_pCompositor->isWindowActive(w.get())) { + wlr_idle_set_enabled(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sSeat.seat, false); + return; + } + + if (w->m_eIdleInhibitMode == IDLEINHIBIT_FULLSCREEN && w->m_bIsFullscreen && g_pCompositor->isWorkspaceVisible(w->m_iWorkspaceID)) { + wlr_idle_set_enabled(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sSeat.seat, false); + return; + } + } + wlr_idle_set_enabled(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sSeat.seat, true); return; }
\ No newline at end of file |
