diff options
| author | Vaxry <vaxry@vaxry.net> | 2023-11-14 15:46:57 +0000 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2023-11-14 15:46:57 +0000 |
| commit | 49597688e975c23b4f3bb53e77617ed3cd1e4937 (patch) | |
| tree | 1f3bc4cf6a87586c7efec917a3661c9258d591a2 /src/Window.cpp | |
| parent | 5edb4e4a304bbef1de30a36f7b921ea328d7efc6 (diff) | |
windowrules: make idleinhibit dynamic
Diffstat (limited to 'src/Window.cpp')
| -rw-r--r-- | src/Window.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Window.cpp b/src/Window.cpp index 770350a4..7569c869 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -591,6 +591,19 @@ void CWindow::applyDynamicRule(const SWindowRule& r) { try { m_sAdditionalConfigData.xray = configStringToInt(vars[1]); } catch (...) {} + } else if (r.szRule.starts_with("idleinhibit")) { + auto IDLERULE = r.szRule.substr(r.szRule.find_first_of(' ') + 1); + + if (IDLERULE == "none") + m_eIdleInhibitMode = IDLEINHIBIT_NONE; + else if (IDLERULE == "always") + m_eIdleInhibitMode = IDLEINHIBIT_ALWAYS; + else if (IDLERULE == "focus") + m_eIdleInhibitMode = IDLEINHIBIT_FOCUS; + else if (IDLERULE == "fullscreen") + m_eIdleInhibitMode = IDLEINHIBIT_FULLSCREEN; + else + Debug::log(ERR, "Rule idleinhibit: unknown mode {}", IDLERULE); } } @@ -615,6 +628,7 @@ void CWindow::updateDynamicRules() { m_sAdditionalConfigData.xray = -1; m_sAdditionalConfigData.forceTearing = false; m_sAdditionalConfigData.nearestNeighbor = false; + m_eIdleInhibitMode = IDLEINHIBIT_NONE; const auto WINDOWRULES = g_pConfigManager->getMatchingRules(this); for (auto& r : WINDOWRULES) { |
