summaryrefslogtreecommitdiff
path: root/src/managers/input/InputManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-11-04 18:09:40 +0000
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-11-04 18:09:40 +0000
commit70aece85224dcca42e6fc596a4b68d688ad6c295 (patch)
treee269eb7a95feeaf774ab10c489e3bdb56d279b04 /src/managers/input/InputManager.cpp
parentc9eb0f3aabf4e6ea96aa6a20d2e2b10d19adeb36 (diff)
constraint focus simplifications
Diffstat (limited to 'src/managers/input/InputManager.cpp')
-rw-r--r--src/managers/input/InputManager.cpp23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index e7eaf646..c3a589ab 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -70,8 +70,6 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
const auto PMONITOR = g_pCompositor->getMonitorFromCursor();
- bool didConstraintOnCursor = false;
-
// constraints
// All constraints TODO: multiple mice?
if (g_pCompositor->m_sSeat.mouse->currentConstraint) {
@@ -104,21 +102,21 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
wlr_cursor_warp_closest(g_pCompositor->m_sWLRCursor, g_pCompositor->m_sSeat.mouse->mouse, newConstrainedCoords.x, newConstrainedCoords.y);
mouseCoords = newConstrainedCoords;
-
- didConstraintOnCursor = true;
}
} else {
if ((!CONSTRAINTWINDOW->m_bIsX11 && PMONITOR && CONSTRAINTWINDOW->m_iWorkspaceID == PMONITOR->activeWorkspace) || (CONSTRAINTWINDOW->m_bIsX11)) {
g_pCompositor->m_sSeat.mouse->constraintActive = true;
- if (CONSTRAINTWINDOW->m_bIsX11) {
- foundSurface = g_pXWaylandManager->getWindowSurface(CONSTRAINTWINDOW);
- surfacePos = CONSTRAINTWINDOW->m_vRealPosition.vec();
- } else {
- g_pCompositor->vectorWindowToSurface(mouseCoords, CONSTRAINTWINDOW, surfaceCoords);
- }
- pFoundWindow = CONSTRAINTWINDOW;
}
}
+
+ if (CONSTRAINTWINDOW->m_bIsX11) {
+ foundSurface = g_pXWaylandManager->getWindowSurface(CONSTRAINTWINDOW);
+ surfacePos = CONSTRAINTWINDOW->m_vRealPosition.vec();
+ } else {
+ g_pCompositor->vectorWindowToSurface(mouseCoords, CONSTRAINTWINDOW, surfaceCoords);
+ }
+
+ pFoundWindow = CONSTRAINTWINDOW;
}
}
@@ -127,9 +125,6 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
g_pLayoutManager->getCurrentLayout()->onMouseMove(getMouseCoordsInternal());
- if (didConstraintOnCursor)
- return; // don't process when cursor constrained
-
if (PMONITOR && PMONITOR != g_pCompositor->m_pLastMonitor) {
g_pCompositor->m_pLastMonitor = PMONITOR;