From 1aed45f61d2dd48943a63cabf7bd77c19a59cf62 Mon Sep 17 00:00:00 2001 From: Aqa-Ib Date: Sun, 31 Mar 2024 01:48:39 +0100 Subject: core: Fix resizeparams (#5262) * Revert a94b902 * Fix resizeparams using CVarList * clang-format * fix * Use 's' as delimiter * remove size checks * fix tabs * fix mixing tabs and spaces --- src/Compositor.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 6276b735..30e769e3 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -10,6 +10,7 @@ #include // for sd_notify #endif #include +#include "helpers/VarList.hpp" int handleCritSignal(int signo, void* data) { Debug::log(LOG, "Hyprland received signal {}", signo); @@ -2545,7 +2546,7 @@ SLayerSurface* CCompositor::getLayerSurfaceFromSurface(wlr_surface* pSurface) { // returns a delta Vector2D CCompositor::parseWindowVectorArgsRelative(const std::string& args, const Vector2D& relativeTo) { - if (!args.contains(' ')) + if (!args.contains(' ') && !args.contains('\t')) return relativeTo; const auto PMONITOR = m_pLastMonitor; @@ -2554,12 +2555,13 @@ Vector2D CCompositor::parseWindowVectorArgsRelative(const std::string& args, con bool yIsPercent = false; bool isExact = false; - std::string x = args.substr(0, args.find_first_of(' ')); - std::string y = args.substr(args.find_last_of(' ') + 1); + CVarList varList(args, 0, 's', true); + std::string x = varList[0]; + std::string y = varList[1]; if (x == "exact") { - x = y.substr(0, y.find_first_of(' ')); - y = y.substr(y.find_first_of(' ') + 1); + x = varList[1]; + y = varList[2]; isExact = true; } -- cgit v1.2.3