fix fullscreen/maximise moving the scrolling view

This commit is contained in:
erstarr 2026-04-04 06:37:15 +02:00
parent a2c2a93f79
commit 91b3bfac92
6 changed files with 9 additions and 3 deletions

View file

@ -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) {

View file

@ -339,6 +339,8 @@ void CLayoutManager::recalculateMonitor(PHLMONITOR m, std::optional<eRecalculate
m->m_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::optional<eRecalculate
m->m_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;

View file

@ -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<ITarget> target, SP<CSpace> space);

View file

@ -811,7 +811,7 @@ void CScrollingAlgorithm::recalculate(std::optional<eRecalculateReason> 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);
}
}

View file

@ -159,7 +159,7 @@ void CSpace::setFullscreen(SP<ITarget> 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) {

View file

@ -17,6 +17,7 @@ namespace Layout {
RECALCULATE_REASON_WORKSPACE_CHANGE,
RECALCULATE_REASON_SPECIAL_WORKSPACE_TOGGLE,
RECALCULATE_REASON_HYPRCTL_KEYWORD,
RECALCULATE_REASON_TOGGLE_FULLSCREEN,
};