warp cursor on focus change

This commit is contained in:
vaxerski 2022-04-09 13:33:44 +02:00
parent 3d5e2c1dc3
commit eea92231fa
1 changed files with 4 additions and 1 deletions

View File

@ -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);
}
}