layout: warp the cursor when focusing windows (#4982)

Similar to the `focuswindow` dispatcher, when focusing a window with
wlr-foreign-toplevel-management, the cursor should be warped. Otherwise, the
focus is lost immediately after the cursor moves.
This commit is contained in:
Junxuan Liao
2024-03-06 01:56:06 +08:00
committed by GitHub
parent bdfa8ab856
commit f8a081b56d

View File

@@ -593,6 +593,7 @@ void IHyprLayout::bringWindowToTop(CWindow* pWindow) {
void IHyprLayout::requestFocusForWindow(CWindow* pWindow) {
bringWindowToTop(pWindow);
g_pCompositor->focusWindow(pWindow);
g_pCompositor->warpCursorTo(pWindow->middle());
}
Vector2D IHyprLayout::predictSizeForNewWindow() {