From ea0930a18b72e4cea439a8a25380695f61221d96 Mon Sep 17 00:00:00 2001 From: memchr Date: Sat, 15 Jun 2024 12:05:36 +0000 Subject: [PATCH] warp_on_change_workspace: check if focused layer is a window. --- src/managers/KeybindManager.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 6e3866313e8..9a7a3d70411 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -1121,13 +1121,10 @@ void CKeybindManager::changeworkspace(std::string args) { const static auto PWARPONWORKSPACECHANGE = CConfigValue("cursor:warp_on_change_workspace"); if (*PWARPONWORKSPACECHANGE) { - Vector2D surfaceCoords; - PHLLS pFoundLayerSurface; - auto PLAST = pWorkspaceToChangeTo->getLastFocusedWindow(); + auto PLAST = pWorkspaceToChangeTo->getLastFocusedWindow(); + auto HLSurface = CWLSurface::fromResource(g_pSeatManager->state.pointerFocus.lock()); - if (PLAST && - !g_pCompositor->vectorToLayerSurface(g_pInputManager->getMouseCoordsInternal(), &PMONITOR->m_aLayerSurfaceLayers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], &surfaceCoords, - &pFoundLayerSurface)) + if (PLAST && (!HLSurface || HLSurface->getWindow())) PLAST->warpCursor(); } }