From 96de3464c472fce451f8af3f4022983157e5453c Mon Sep 17 00:00:00 2001 From: erstarr <253168930+erstarr@users.noreply.github.com> Date: Fri, 15 May 2026 17:08:42 +0200 Subject: [PATCH] windows/focus: differentiate fullscreen focus reason into default and layout handled reasons. (#14370) * differentiate RECALCULATE_REASON_TOGGLE_FULLSCREEN into default and layout handled reasons. * fix * add layout handled fs reason as not a hard focus reason. fullscreen handler fits the col to view anyway * clang-format --- src/Compositor.cpp | 3 ++- src/layout/space/Space.cpp | 7 ++++--- src/layout/space/Space.hpp | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Compositor.cpp b/src/Compositor.cpp index d2fe2f9c8..1d2dda2a9 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -2311,7 +2311,8 @@ void CCompositor::setWindowFullscreenState(const PHLWINDOW PWINDOW, Desktop::Vie // because the windows below fs are not visible obviously but because we update fullscreen fade which sets that // state later, it does it wrong PWORKSPACE->updateWindows(); - PWORKSPACE->m_space->recalculate(); + PWORKSPACE->m_space->recalculate(FULLSCREEN_REQUEST_RESULT == Layout::FULLSCREEN_REQUEST_DEFAULT ? Layout::RECALCULATE_REASON_TOGGLE_DEFAULT_HANDLED_FULLSCREEN : + Layout::RECALCULATE_REASON_TOGGLE_LAYOUT_HANDLED_FULLSCREEN); PWORKSPACE->forceReportSizesToWindows(); g_pInputManager->recheckIdleInhibitorStatus(); diff --git a/src/layout/space/Space.cpp b/src/layout/space/Space.cpp index f4785d76a..7ca2f83fe 100644 --- a/src/layout/space/Space.cpp +++ b/src/layout/space/Space.cpp @@ -173,7 +173,7 @@ eFullscreenRequestResult CSpace::setFullscreen(SP t, eFullscreenMode cu if (mode == FSMODE_NONE && m_algorithm && t->floating()) m_algorithm->recenter(t); - recalculate(RECALCULATE_REASON_TOGGLE_FULLSCREEN); + recalculate(REQUEST_RESULT == FULLSCREEN_REQUEST_DEFAULT ? RECALCULATE_REASON_TOGGLE_DEFAULT_HANDLED_FULLSCREEN : RECALCULATE_REASON_TOGGLE_LAYOUT_HANDLED_FULLSCREEN); return REQUEST_RESULT; } @@ -219,7 +219,8 @@ SP CSpace::getNextCandidate(SP old) { } bool Layout::isHardRecalculateReason(eRecalculateReason reason) { - return reason != RECALCULATE_REASON_WORKSPACE_CHANGE && reason != RECALCULATE_REASON_SPECIAL_WORKSPACE_TOGGLE && reason != RECALCULATE_REASON_TOGGLE_FULLSCREEN && + return reason != RECALCULATE_REASON_WORKSPACE_CHANGE && reason != RECALCULATE_REASON_SPECIAL_WORKSPACE_TOGGLE && + reason != RECALCULATE_REASON_TOGGLE_LAYOUT_HANDLED_FULLSCREEN && reason != RECALCULATE_REASON_TOGGLE_DEFAULT_HANDLED_FULLSCREEN && reason != RECALCULATE_REASON_INVALIDATE_MONITOR_GEOMETRIES && reason != RECALCULATE_REASON_RENDER_MOINTOR; } @@ -232,7 +233,7 @@ eRecalculateReason Layout::recalcMonitorReasonToRecalcReason(CLayoutManager::eRe switch (reason) { case CLayoutManager::RECALCULATE_MONITOR_REASON_TOGGLE_SPECIAL_WORKSPACE: return RECALCULATE_REASON_SPECIAL_WORKSPACE_TOGGLE; case CLayoutManager::RECALCULATE_MONITOR_REASON_WORKSPACE_CHANGE: return RECALCULATE_REASON_WORKSPACE_CHANGE; - case CLayoutManager::RECALCULATE_MONITOR_REASON_TOGGLE_FULLSCREEN: return RECALCULATE_REASON_TOGGLE_FULLSCREEN; + case CLayoutManager::RECALCULATE_MONITOR_REASON_TOGGLE_FULLSCREEN: return RECALCULATE_REASON_TOGGLE_DEFAULT_HANDLED_FULLSCREEN; default: return RECALCULATE_REASON_UNKNOWN; } } \ No newline at end of file diff --git a/src/layout/space/Space.hpp b/src/layout/space/Space.hpp index af731a506..1d0ea575f 100644 --- a/src/layout/space/Space.hpp +++ b/src/layout/space/Space.hpp @@ -17,7 +17,8 @@ namespace Layout { RECALCULATE_REASON_UNKNOWN, // when the recalculate reason is unknown or not important to preserve RECALCULATE_REASON_WORKSPACE_CHANGE, RECALCULATE_REASON_SPECIAL_WORKSPACE_TOGGLE, - RECALCULATE_REASON_TOGGLE_FULLSCREEN, + RECALCULATE_REASON_TOGGLE_DEFAULT_HANDLED_FULLSCREEN, + RECALCULATE_REASON_TOGGLE_LAYOUT_HANDLED_FULLSCREEN, RECALCULATE_REASON_INVALIDATE_MONITOR_GEOMETRIES, RECALCULATE_REASON_RENDER_MOINTOR, };