diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-04-09 13:33:44 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-04-09 13:33:44 +0200 |
| commit | eea92231fa921419403782097898600b1e845b3b (patch) | |
| tree | 5991d95ea6e4964a1660f2bf225927d6f0a8f3a2 /src/managers/KeybindManager.cpp | |
| parent | 3d5e2c1dc34e1099fd56bad61848f7a48268ea77 (diff) | |
warp cursor on focus change
Diffstat (limited to 'src/managers/KeybindManager.cpp')
| -rw-r--r-- | src/managers/KeybindManager.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 8cf22892..ac66dd14 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -261,6 +261,9 @@ void CKeybindManager::moveFocusTo(std::string args) { const auto PWINDOWTOCHANGETO = g_pCompositor->getWindowInDirection(PLASTWINDOW, arg); - if (PWINDOWTOCHANGETO) + if (PWINDOWTOCHANGETO) { g_pCompositor->focusWindow(PWINDOWTOCHANGETO); + Vector2D middle = PWINDOWTOCHANGETO->m_vPosition + PWINDOWTOCHANGETO->m_vSize / 2.f; + wlr_cursor_warp(g_pCompositor->m_sWLRCursor, nullptr, middle.x, middle.y); + } }
\ No newline at end of file |
