From f8a081b56d09ec325ac485a0f055e541146486d3 Mon Sep 17 00:00:00 2001 From: Junxuan Liao <70618504+MikeWalrus@users.noreply.github.com> Date: Wed, 6 Mar 2024 01:56:06 +0800 Subject: [PATCH] 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. --- src/layout/IHyprLayout.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp index d48f15fa..2a84b024 100644 --- a/src/layout/IHyprLayout.cpp +++ b/src/layout/IHyprLayout.cpp @@ -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() {