summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/events/Windows.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp
index 54a5486c..53539eee 100644
--- a/src/events/Windows.cpp
+++ b/src/events/Windows.cpp
@@ -387,10 +387,14 @@ void Events::listener_mapWindow(void* owner, void* data) {
int posY = 0;
if (POSXSTR.starts_with("100%-")) {
- const auto POSXRAW = POSXSTR.substr(5);
+ const bool subtractWindow = POSXSTR.starts_with("100%-w-");
+ const auto POSXRAW = (subtractWindow) ? POSXSTR.substr(7) : POSXSTR.substr(5);
posX =
PMONITOR->vecSize.x - (!POSXRAW.contains('%') ? std::stoi(POSXRAW) : std::stof(POSXRAW.substr(0, POSXRAW.length() - 1)) * 0.01 * PMONITOR->vecSize.x);
+ if (subtractWindow)
+ posX -= PWINDOW->m_vRealSize.goal().x;
+
if (CURSOR)
Debug::log(ERR, "Cursor is not compatible with 100%-, ignoring cursor!");
} else if (!CURSOR) {
@@ -406,10 +410,14 @@ void Events::listener_mapWindow(void* owner, void* data) {
}
if (POSYSTR.starts_with("100%-")) {
- const auto POSYRAW = POSYSTR.substr(5);
+ const bool subtractWindow = POSYSTR.starts_with("100%-w-");
+ const auto POSYRAW = (subtractWindow) ? POSYSTR.substr(7) : POSYSTR.substr(5);
posY =
PMONITOR->vecSize.y - (!POSYRAW.contains('%') ? std::stoi(POSYRAW) : std::stof(POSYRAW.substr(0, POSYRAW.length() - 1)) * 0.01 * PMONITOR->vecSize.y);
+ if (subtractWindow)
+ posY -= PWINDOW->m_vRealSize.goal().y;
+
if (CURSOR)
Debug::log(ERR, "Cursor is not compatible with 100%-, ignoring cursor!");
} else if (!CURSOR) {