From 890307532caa3369ea089b606b7786ccce4b8504 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Mon, 12 Feb 2024 20:01:50 +0000 Subject: [PATCH] input: avoid reassigns of unchanged surfaces in processMouseRequest --- src/managers/input/InputManager.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 9f713b03..b36b0034 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -487,10 +487,15 @@ void CInputManager::processMouseRequest(wlr_seat_pointer_request_set_cursor_even return; if (e->seat_client == g_pCompositor->m_sSeat.seat->pointer_state.focused_client) { - m_sCursorSurfaceInfo.wlSurface.unassign(); + + if (e->surface != m_sCursorSurfaceInfo.wlSurface.wlr()) { + m_sCursorSurfaceInfo.wlSurface.unassign(); + + if (e->surface) + m_sCursorSurfaceInfo.wlSurface.assign(e->surface); + } if (e->surface) { - m_sCursorSurfaceInfo.wlSurface.assign(e->surface); m_sCursorSurfaceInfo.vHotspot = {e->hotspot_x, e->hotspot_y}; m_sCursorSurfaceInfo.hidden = false; } else {