summaryrefslogtreecommitdiff
path: root/src/Compositor.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-09-03 15:35:53 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-09-03 15:35:53 +0200
commitf4add0ac6d633379ade7470a5e6b4afd45f4a073 (patch)
treec3f283024c927191d4e609f8651081cad92b7991 /src/Compositor.cpp
parent3c3f80c2fe093303b84cd52be22b523ea06a3c6e (diff)
refocus on reserved area
Diffstat (limited to 'src/Compositor.cpp')
-rw-r--r--src/Compositor.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp
index 8d24e8dd..8eb75002 100644
--- a/src/Compositor.cpp
+++ b/src/Compositor.cpp
@@ -1775,4 +1775,15 @@ void CCompositor::forceReportSizesToWindowsOnWorkspace(const int& wid) {
g_pXWaylandManager->setWindowSize(w.get(), w->m_vRealSize.vec(), true);
}
}
-} \ No newline at end of file
+}
+
+bool CCompositor::cursorOnReservedArea() {
+ const auto PMONITOR = getMonitorFromCursor();
+
+ const auto XY1 = PMONITOR->vecPosition + PMONITOR->vecReservedTopLeft;
+ const auto XY2 = PMONITOR->vecPosition + PMONITOR->vecSize - PMONITOR->vecReservedBottomRight;
+
+ const auto CURSORPOS = g_pInputManager->getMouseCoordsInternal();
+
+ return !VECINRECT(CURSORPOS, XY1.x, XY1.y, XY2.x, XY2.y);
+}