diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2026-05-07 15:21:06 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-07 15:21:06 +0100 |
| commit | 58833eb1d79d7f03402cee0730c309b79f2e4501 (patch) | |
| tree | 180cadc5d2e6fcb9e2f090eeccc6fb4ccace9b51 /src/layout/space/Space.cpp | |
| parent | 6b8b20100253c083227e611be20360f4d8e7794e (diff) | |
layout/scrolling: handle fullscreen manually (#14190)
Makes scroll handle fullscreen by itself, allowing for fs scrolls.
Diffstat (limited to 'src/layout/space/Space.cpp')
| -rw-r--r-- | src/layout/space/Space.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/layout/space/Space.cpp b/src/layout/space/Space.cpp index 26c02aae..35741a14 100644 --- a/src/layout/space/Space.cpp +++ b/src/layout/space/Space.cpp @@ -153,13 +153,29 @@ void CSpace::recalculate() { m_algorithm->recalculate(); } -void CSpace::setFullscreen(SP<ITarget> t, eFullscreenMode mode) { - t->setFullscreenMode(mode); +eFullscreenRequestResult CSpace::setFullscreen(SP<ITarget> t, eFullscreenMode currentEffectiveMode, eFullscreenMode mode) { + if (!t) + return FULLSCREEN_REQUEST_DEFAULT; + + const auto REQUEST_RESULT = m_algorithm ? m_algorithm->requestFullscreen(t, currentEffectiveMode, mode) : FULLSCREEN_REQUEST_DEFAULT; + + t->setLayoutManagedFullscreen(REQUEST_RESULT == FULLSCREEN_REQUEST_HANDLED_BY_LAYOUT && mode == FSMODE_FULLSCREEN); + if (REQUEST_RESULT != FULLSCREEN_REQUEST_HANDLED_BY_LAYOUT) + t->setFullscreenMode(mode); + + if (REQUEST_RESULT == FULLSCREEN_REQUEST_HANDLED_BY_LAYOUT) { + if (const auto WORKSPACE = workspace()) { + WORKSPACE->m_fullscreenMode = FSMODE_NONE; + WORKSPACE->m_hasFullscreenWindow = false; + } + } if (mode == FSMODE_NONE && m_algorithm && t->floating()) m_algorithm->recenter(t); recalculate(); + + return REQUEST_RESULT; } Config::ErrorResult CSpace::layoutMsg(const std::string_view& sv) { |
