diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-06-12 14:31:07 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-12 14:31:07 +0200 |
| commit | 2208be51752fcc7a63288dca0cbac3454f322534 (patch) | |
| tree | 0acdfc3e0068dfac627822d5d1abc0fc8305d0a3 /src/managers/input | |
| parent | 70eb5053fb7650f019e8b825c7b24cfbaa1f33f4 (diff) | |
| parent | 46d11f7646b3032c703f9caef8b0de08f279839e (diff) | |
Merge pull request #197 from spectreseven1138/main
Add loose follow_mouse option
Diffstat (limited to 'src/managers/input')
| -rw-r--r-- | src/managers/input/InputManager.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 4a35a8c7..977ab06d 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -167,12 +167,16 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { Vector2D surfaceLocal = surfacePos == Vector2D(-1337, -1337) ? surfaceCoords : mouseCoords - surfacePos; if (pFoundWindow) { - if (g_pConfigManager->getInt("input:follow_mouse") == 0 && !refocus) { + static auto *const PFOLLOWMOUSE = &g_pConfigManager->getConfigValuePtr("input:follow_mouse")->intValue; + if (*PFOLLOWMOUSE != 1 && !refocus) { if (pFoundWindow != g_pCompositor->m_pLastWindow && g_pCompositor->windowValidMapped(g_pCompositor->m_pLastWindow) && (g_pCompositor->m_pLastWindow->m_bIsFloating != pFoundWindow->m_bIsFloating)) { // enter if change floating style g_pCompositor->focusWindow(pFoundWindow, foundSurface); wlr_seat_pointer_notify_enter(g_pCompositor->m_sSeat.seat, foundSurface, surfaceLocal.x, surfaceLocal.y); } + else if (*PFOLLOWMOUSE == 2) { + wlr_seat_pointer_notify_enter(g_pCompositor->m_sSeat.seat, foundSurface, surfaceLocal.x, surfaceLocal.y); + } wlr_seat_pointer_notify_motion(g_pCompositor->m_sSeat.seat, time, surfaceLocal.x, surfaceLocal.y); return; // don't enter any new surfaces } else { |
