aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAqa-Ib <[email protected]>2024-03-31 01:48:39 +0100
committerGitHub <[email protected]>2024-03-31 00:48:39 +0000
commit1aed45f61d2dd48943a63cabf7bd77c19a59cf62 (patch)
treec112cc4e8bb02214fc87cc722a6d65ada83f8e46
parent77f26997fd00aaec958463414269fa3d8f62bb63 (diff)
downloadHyprland-1aed45f61d2dd48943a63cabf7bd77c19a59cf62.tar.gz
Hyprland-1aed45f61d2dd48943a63cabf7bd77c19a59cf62.zip
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
-rw-r--r--src/Compositor.cpp12
1 files 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 <systemd/sd-daemon.h> // for sd_notify
#endif
#include <ranges>
+#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;
}