diff options
| author | Felix Dick <felix.dick@web.de> | 2022-09-29 01:42:28 +0200 |
|---|---|---|
| committer | Felix Dick <felix.dick@web.de> | 2022-09-29 01:42:28 +0200 |
| commit | a1319e51108997b9335aec4c36db5bbc5b3b5bba (patch) | |
| tree | d3478c865739836c10cc71de1abed649c79ca434 /src/events/Windows.cpp | |
| parent | 5233746ac5d1a9d00462662b7778ebbacdc523dd (diff) | |
| parent | 31cb4c49d9f977d4cb0876cf1124bf9e86a60669 (diff) | |
Merge branch 'main' into fix_bordersize_again
Diffstat (limited to 'src/events/Windows.cpp')
| -rw-r--r-- | src/events/Windows.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index 95bc6c75..b67a8619 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -235,8 +235,8 @@ void Events::listener_mapWindow(void* owner, void* data) { const auto MAXSIZE = g_pXWaylandManager->getMaxSizeForWindow(PWINDOW); - const auto SIZEX = SIZEXSTR == "max" ? std::clamp(MAXSIZE.x, (double)20, PMONITOR->vecSize.x) : (!SIZEXSTR.contains('%') ? std::stoi(SIZEXSTR) : std::stoi(SIZEXSTR.substr(0, SIZEXSTR.length() - 1)) * 0.01f * PMONITOR->vecSize.x); - const auto SIZEY = SIZEYSTR == "max" ? std::clamp(MAXSIZE.y, (double)20, PMONITOR->vecSize.y) : (!SIZEYSTR.contains('%') ? std::stoi(SIZEYSTR) : std::stoi(SIZEYSTR.substr(0, SIZEYSTR.length() - 1)) * 0.01f * PMONITOR->vecSize.y); + const auto SIZEX = SIZEXSTR == "max" ? std::clamp(MAXSIZE.x, 20.0, PMONITOR->vecSize.x) : (!SIZEXSTR.contains('%') ? std::stoi(SIZEXSTR) : std::stoi(SIZEXSTR.substr(0, SIZEXSTR.length() - 1)) * 0.01 * PMONITOR->vecSize.x); + const auto SIZEY = SIZEYSTR == "max" ? std::clamp(MAXSIZE.y, 20.0, PMONITOR->vecSize.y) : (!SIZEYSTR.contains('%') ? std::stoi(SIZEYSTR) : std::stoi(SIZEYSTR.substr(0, SIZEYSTR.length() - 1)) * 0.01 * PMONITOR->vecSize.y); Debug::log(LOG, "Rule size, applying to window %x", PWINDOW); @@ -253,8 +253,8 @@ void Events::listener_mapWindow(void* owner, void* data) { const auto POSXSTR = VALUE.substr(0, VALUE.find(" ")); const auto POSYSTR = VALUE.substr(VALUE.find(" ") + 1); - const auto POSX = !POSXSTR.contains('%') ? std::stoi(POSXSTR) : std::stoi(POSXSTR.substr(0, POSXSTR.length() - 1)) * 0.01f * PMONITOR->vecSize.x; - const auto POSY = !POSYSTR.contains('%') ? std::stoi(POSYSTR) : std::stoi(POSYSTR.substr(0, POSYSTR.length() - 1)) * 0.01f * PMONITOR->vecSize.y; + const auto POSX = !POSXSTR.contains('%') ? std::stoi(POSXSTR) : std::stoi(POSXSTR.substr(0, POSXSTR.length() - 1)) * 0.01 * PMONITOR->vecSize.x; + const auto POSY = !POSYSTR.contains('%') ? std::stoi(POSYSTR) : std::stoi(POSYSTR.substr(0, POSYSTR.length() - 1)) * 0.01 * PMONITOR->vecSize.y; Debug::log(LOG, "Rule move, applying to window %x", PWINDOW); |
