diff --git a/src/Compositor.cpp b/src/Compositor.cpp index ab371df22..f6b54b226 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -2259,7 +2259,7 @@ void CCompositor::setWindowFullscreenState(const PHLWINDOW PWINDOW, Desktop::Vie Desktop::Rule::RULE_PROP_FULLSCREENSTATE_INTERNAL | Desktop::Rule::RULE_PROP_ON_WORKSPACE); PWINDOW->updateDecorationValues(); - g_layoutManager->recalculateMonitor(PMONITOR); + g_layoutManager->recalculateMonitor(PMONITOR, Layout::CLayoutManager::RECALCULATE_MONITOR_REASON_TOGGLE_FULLSCREEN); // make all windows and layers on the same workspace under the fullscreen window for (auto const& w : m_windows) { diff --git a/src/layout/LayoutManager.cpp b/src/layout/LayoutManager.cpp index 57fd99ea0..51e85be93 100644 --- a/src/layout/LayoutManager.cpp +++ b/src/layout/LayoutManager.cpp @@ -339,6 +339,8 @@ void CLayoutManager::recalculateMonitor(PHLMONITOR m, std::optionalm_activeSpecialWorkspace->m_space->recalculate(RECALCULATE_REASON_SPECIAL_WORKSPACE_TOGGLE); else if (reason == RECALCULATE_MONITOR_REASON_HYPRCTL_KEYWORD) m->m_activeSpecialWorkspace->m_space->recalculate(RECALCULATE_REASON_HYPRCTL_KEYWORD); + else if (reason == RECALCULATE_MONITOR_REASON_TOGGLE_FULLSCREEN) + m->m_activeSpecialWorkspace->m_space->recalculate(RECALCULATE_REASON_TOGGLE_FULLSCREEN); else m->m_activeSpecialWorkspace->m_space->recalculate(); return; @@ -349,6 +351,8 @@ void CLayoutManager::recalculateMonitor(PHLMONITOR m, std::optionalm_activeWorkspace->m_space->recalculate(RECALCULATE_REASON_WORKSPACE_CHANGE); else if (reason == RECALCULATE_MONITOR_REASON_HYPRCTL_KEYWORD) m->m_activeWorkspace->m_space->recalculate(RECALCULATE_REASON_HYPRCTL_KEYWORD); + else if (reason == RECALCULATE_MONITOR_REASON_TOGGLE_FULLSCREEN) + m->m_activeWorkspace->m_space->recalculate(RECALCULATE_REASON_TOGGLE_FULLSCREEN); else m->m_activeWorkspace->m_space->recalculate(); return; diff --git a/src/layout/LayoutManager.hpp b/src/layout/LayoutManager.hpp index 977d21cbe..abc704516 100644 --- a/src/layout/LayoutManager.hpp +++ b/src/layout/LayoutManager.hpp @@ -49,6 +49,7 @@ namespace Layout { RECALCULATE_MONITOR_REASON_WORKSPACE_CHANGE, RECALCULATE_MONITOR_REASON_TOGGLE_SPECIAL_WORKSPACE, RECALCULATE_MONITOR_REASON_HYPRCTL_KEYWORD, + RECALCULATE_MONITOR_REASON_TOGGLE_FULLSCREEN, }; void newTarget(SP target, SP space); diff --git a/src/layout/algorithm/tiled/scrolling/ScrollingAlgorithm.cpp b/src/layout/algorithm/tiled/scrolling/ScrollingAlgorithm.cpp index 2de2ec62a..0ae147f3a 100644 --- a/src/layout/algorithm/tiled/scrolling/ScrollingAlgorithm.cpp +++ b/src/layout/algorithm/tiled/scrolling/ScrollingAlgorithm.cpp @@ -811,7 +811,7 @@ void CScrollingAlgorithm::recalculate(std::optional reason) // TODO: erstarr Maybe do smt about this mess // RECALCULATE_REASON_WORKSPACE_CHANGE, RECALCULATE_REASON_SPECIAL_WORKSPACE_TOGGLE => guard against scrolling view move when switching workspaces when target is scrolling (special or not) // RECALCULATE_REASON_HYPRCTL_KEYWORD => guard against `hyprctl keyword` commands moving scrolling view - if (reason != RECALCULATE_REASON_WORKSPACE_CHANGE && reason != RECALCULATE_REASON_SPECIAL_WORKSPACE_TOGGLE && reason != RECALCULATE_REASON_HYPRCTL_KEYWORD) + if (reason != RECALCULATE_REASON_WORKSPACE_CHANGE && reason != RECALCULATE_REASON_SPECIAL_WORKSPACE_TOGGLE && reason != RECALCULATE_REASON_HYPRCTL_KEYWORD && reason != RECALCULATE_REASON_TOGGLE_FULLSCREEN) focusOnInput(Desktop::focusState()->window()->layoutTarget(), INPUT_MODE_HARD); } } diff --git a/src/layout/space/Space.cpp b/src/layout/space/Space.cpp index 7d95e1b3f..eca35df78 100644 --- a/src/layout/space/Space.cpp +++ b/src/layout/space/Space.cpp @@ -159,7 +159,7 @@ void CSpace::setFullscreen(SP t, eFullscreenMode mode) { if (mode == FSMODE_NONE && m_algorithm && t->floating()) m_algorithm->recenter(t); - recalculate(); + recalculate(RECALCULATE_REASON_TOGGLE_FULLSCREEN); } Config::ErrorResult CSpace::layoutMsg(const std::string_view& sv) { diff --git a/src/layout/space/Space.hpp b/src/layout/space/Space.hpp index 18b26945d..db0deb55b 100644 --- a/src/layout/space/Space.hpp +++ b/src/layout/space/Space.hpp @@ -17,6 +17,7 @@ namespace Layout { RECALCULATE_REASON_WORKSPACE_CHANGE, RECALCULATE_REASON_SPECIAL_WORKSPACE_TOGGLE, RECALCULATE_REASON_HYPRCTL_KEYWORD, + RECALCULATE_REASON_TOGGLE_FULLSCREEN, };