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
This commit is contained in:
Aqa-Ib 2024-03-31 01:48:39 +01:00 committed by GitHub
parent 77f26997fd
commit 1aed45f61d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -10,6 +10,7 @@
#include <systemd/sd-daemon.h> // for sd_notify #include <systemd/sd-daemon.h> // for sd_notify
#endif #endif
#include <ranges> #include <ranges>
#include "helpers/VarList.hpp"
int handleCritSignal(int signo, void* data) { int handleCritSignal(int signo, void* data) {
Debug::log(LOG, "Hyprland received signal {}", signo); Debug::log(LOG, "Hyprland received signal {}", signo);
@ -2545,7 +2546,7 @@ SLayerSurface* CCompositor::getLayerSurfaceFromSurface(wlr_surface* pSurface) {
// returns a delta // returns a delta
Vector2D CCompositor::parseWindowVectorArgsRelative(const std::string& args, const Vector2D& relativeTo) { Vector2D CCompositor::parseWindowVectorArgsRelative(const std::string& args, const Vector2D& relativeTo) {
if (!args.contains(' ')) if (!args.contains(' ') && !args.contains('\t'))
return relativeTo; return relativeTo;
const auto PMONITOR = m_pLastMonitor; const auto PMONITOR = m_pLastMonitor;
@ -2554,12 +2555,13 @@ Vector2D CCompositor::parseWindowVectorArgsRelative(const std::string& args, con
bool yIsPercent = false; bool yIsPercent = false;
bool isExact = false; bool isExact = false;
std::string x = args.substr(0, args.find_first_of(' ')); CVarList varList(args, 0, 's', true);
std::string y = args.substr(args.find_last_of(' ') + 1); std::string x = varList[0];
std::string y = varList[1];
if (x == "exact") { if (x == "exact") {
x = y.substr(0, y.find_first_of(' ')); x = varList[1];
y = y.substr(y.find_first_of(' ') + 1); y = varList[2];
isExact = true; isExact = true;
} }