diff options
| author | Nikolai Nechaev <nikolay_nechaev@mail.ru> | 2025-11-26 07:44:26 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-25 22:44:26 +0000 |
| commit | 40d8fa84919c6d0e9fcb1536f4bc09710d4c031c (patch) | |
| tree | e45044c92e5d8f716f2aa15668c61fed5aaf5895 /hyprtester/plugin/src/main.cpp | |
| parent | 1c1746de61a90dbbae072f3fc618c45af33fdd59 (diff) | |
compositor: Configurable behavior when window to be focused conflicts with fullscreen (#12033)
Renames `misc:new_window_takes_over_fullscreen` into
`misc:on_focus_under_fullscreen` and implements the following behavior:
- By default, when a tiling window is being focused on a workspace where
a fullscreen/maximized window exists, respect
the `misc:on_focus_under_fullscreen` config variable.
Diffstat (limited to 'hyprtester/plugin/src/main.cpp')
| -rw-r--r-- | hyprtester/plugin/src/main.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/hyprtester/plugin/src/main.cpp b/hyprtester/plugin/src/main.cpp index 72120eac..cbc06723 100644 --- a/hyprtester/plugin/src/main.cpp +++ b/hyprtester/plugin/src/main.cpp @@ -14,6 +14,7 @@ #include <src/desktop/rule/windowRule/WindowRuleEffectContainer.hpp> #include <src/desktop/rule/windowRule/WindowRuleApplicator.hpp> #include <src/Compositor.hpp> +#include <src/desktop/state/FocusState.hpp> #undef private #include <hyprutils/utils/ScopeGuard.hpp> @@ -45,7 +46,7 @@ static SDispatchResult test(std::string in) { // Trigger a snap move event for the active window static SDispatchResult snapMove(std::string in) { - const auto PLASTWINDOW = g_pCompositor->m_lastWindow.lock(); + const auto PLASTWINDOW = Desktop::focusState()->window(); if (!PLASTWINDOW->m_isFloating) return {.success = false, .error = "Window must be floating"}; @@ -259,13 +260,15 @@ static SDispatchResult addRule(std::string in) { } static SDispatchResult checkRule(std::string in) { - if (!g_pCompositor->m_lastWindow) + const auto PLASTWINDOW = Desktop::focusState()->window(); + + if (!PLASTWINDOW) return {.success = false, .error = "No window"}; - if (!g_pCompositor->m_lastWindow->m_ruleApplicator->m_otherProps.props.contains(ruleIDX)) + if (!PLASTWINDOW->m_ruleApplicator->m_otherProps.props.contains(ruleIDX)) return {.success = false, .error = "No rule"}; - if (g_pCompositor->m_lastWindow->m_ruleApplicator->m_otherProps.props[ruleIDX]->effect != "effect") + if (PLASTWINDOW->m_ruleApplicator->m_otherProps.props[ruleIDX]->effect != "effect") return {.success = false, .error = "Effect isn't \"effect\""}; return {}; |
