mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-22 19:49:49 +01:00
warp cursor on focus change
This commit is contained in:
parent
3d5e2c1dc3
commit
eea92231fa
1 changed files with 4 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue