diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-09-03 15:35:53 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-09-03 15:35:53 +0200 |
| commit | f4add0ac6d633379ade7470a5e6b4afd45f4a073 (patch) | |
| tree | c3f283024c927191d4e609f8651081cad92b7991 /src/Compositor.cpp | |
| parent | 3c3f80c2fe093303b84cd52be22b523ea06a3c6e (diff) | |
refocus on reserved area
Diffstat (limited to 'src/Compositor.cpp')
| -rw-r--r-- | src/Compositor.cpp | 13 |
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); +} |
