From 7769e102502cf7779665b55cd12caab37bce2269 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Sun, 8 Jun 2025 13:51:06 +0200 Subject: [PATCH] scrolling: avoid crash on clamp fixes #375 --- hyprscrolling/Scrolling.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hyprscrolling/Scrolling.cpp b/hyprscrolling/Scrolling.cpp index 2c4ebc2..48572ca 100644 --- a/hyprscrolling/Scrolling.cpp +++ b/hyprscrolling/Scrolling.cpp @@ -504,7 +504,7 @@ void CScrollingLayout::onWindowRemovedTiling(PHLWINDOW window) { if (!DATA->column) { // column got removed, let's ensure we don't leave any cringe extra space const auto USABLE = usableAreaFor(window->m_monitor.lock()); - WS->leftOffset = std::clamp((double)WS->leftOffset, 0.0, WS->maxWidth() - USABLE.w); + WS->leftOffset = std::clamp((double)WS->leftOffset, 0.0, std::max(WS->maxWidth() - USABLE.w, 1.0)); } }