diff options
| author | fvla <fvla@users.noreply.github.com> | 2026-03-26 17:38:56 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-26 21:38:56 +0000 |
| commit | 2fde538e0fa5663ac99f631fcfee6742e09368f6 (patch) | |
| tree | 148017bdc0364f6557219c5f3d059d9ad823ac29 /src/layout/algorithm/tiled/scrolling | |
| parent | b0f6ac23b26e62f650d3b26dfb0aa7eb15e29da8 (diff) | |
algo/scrolling: improve behavior with focus_fit_method = center (#13795)
Diffstat (limited to 'src/layout/algorithm/tiled/scrolling')
| -rw-r--r-- | src/layout/algorithm/tiled/scrolling/ScrollTapeController.cpp | 6 | ||||
| -rw-r--r-- | src/layout/algorithm/tiled/scrolling/ScrollingAlgorithm.cpp | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/layout/algorithm/tiled/scrolling/ScrollTapeController.cpp b/src/layout/algorithm/tiled/scrolling/ScrollTapeController.cpp index 6cd7da9c..657b6542 100644 --- a/src/layout/algorithm/tiled/scrolling/ScrollTapeController.cpp +++ b/src/layout/algorithm/tiled/scrolling/ScrollTapeController.cpp @@ -1,5 +1,6 @@ #include "ScrollTapeController.hpp" #include "ScrollingAlgorithm.hpp" +#include "../../../../config/ConfigValue.hpp" #include <algorithm> #include <cmath> @@ -205,8 +206,9 @@ double CScrollTapeController::calculateCameraOffset(const CBox& usableArea, bool if (maxExtent < usablePrimary) m_offset = std::round((maxExtent - usablePrimary) / 2.0); - // if the offset is negative but we already extended, reset offset to 0 - if (maxExtent > usablePrimary && m_offset < 0.0) + // if the offset is negative but we already extended and fit method is not center, reset offset to 0 + static const auto PFITMETHOD = CConfigValue<Hyprlang::INT>("scrolling:focus_fit_method"); + if (maxExtent > usablePrimary && m_offset < 0.0 && *PFITMETHOD != 0) m_offset = 0.0; return m_offset; diff --git a/src/layout/algorithm/tiled/scrolling/ScrollingAlgorithm.cpp b/src/layout/algorithm/tiled/scrolling/ScrollingAlgorithm.cpp index addd371d..93a83045 100644 --- a/src/layout/algorithm/tiled/scrolling/ScrollingAlgorithm.cpp +++ b/src/layout/algorithm/tiled/scrolling/ScrollingAlgorithm.cpp @@ -580,7 +580,7 @@ void CScrollingAlgorithm::focusOnInput(SP<ITarget> target, eInputMode input) { return; static const auto PFITMETHOD = CConfigValue<Hyprlang::INT>("scrolling:focus_fit_method"); - if (*PFITMETHOD == 1 || input == INPUT_MODE_CLICK) + if (*PFITMETHOD == 1) m_scrollingData->fitCol(TARGETDATA->column.lock()); else m_scrollingData->centerCol(TARGETDATA->column.lock()); |
