From f54dd4da4ab8f1ad27226d05187e3f8b237ef00c Mon Sep 17 00:00:00 2001 From: Vaxry Date: Thu, 8 Jan 2026 12:24:29 +0100 Subject: [PATCH] desktop/reservedArea: clamp to 0 ref https://github.com/hyprwm/Hyprland/discussions/12880 --- src/desktop/reserved/ReservedArea.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/desktop/reserved/ReservedArea.cpp b/src/desktop/reserved/ReservedArea.cpp index b67524ce..856b0a45 100644 --- a/src/desktop/reserved/ReservedArea.cpp +++ b/src/desktop/reserved/ReservedArea.cpp @@ -6,11 +6,12 @@ using namespace Desktop; // fuck me. Writing this at 11pm, and I have an in-class test tomorrow. // I am failing that bitch -CReservedArea::CReservedArea(const Vector2D& tl, const Vector2D& br) : m_initialTopLeft(tl), m_initialBottomRight(br) { +CReservedArea::CReservedArea(const Vector2D& tl, const Vector2D& br) : m_initialTopLeft(tl.clamp({0, 0})), m_initialBottomRight(br.clamp({0, 0})) { calculate(); } -CReservedArea::CReservedArea(double top, double right, double bottom, double left) : m_initialTopLeft(left, top), m_initialBottomRight(right, bottom) { +CReservedArea::CReservedArea(double top, double right, double bottom, double left) : + m_initialTopLeft(std::max(left, 0.0), std::max(top, 0.0)), m_initialBottomRight(std::max(right, 0.0), std::max(bottom, 0.0)) { calculate(); }