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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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