From 7fbf8f98477dfbb2e6b193ef85e0c2d119d3fe80 Mon Sep 17 00:00:00 2001 From: Visal Vijay <150381094+B2krobbery@users.noreply.github.com> Date: Wed, 1 Apr 2026 18:59:37 +0530 Subject: seat: store surface in pointerFocus before sendEnter (#13941) ptr could expire --- src/protocols/core/Seat.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/protocols') diff --git a/src/protocols/core/Seat.cpp b/src/protocols/core/Seat.cpp index 52015fd8..202010aa 100644 --- a/src/protocols/core/Seat.cpp +++ b/src/protocols/core/Seat.cpp @@ -137,8 +137,10 @@ CWLPointerResource::CWLPointerResource(SP resource_, SPonSetCursor(m_owner.lock(), serial, surfResource, {hotX, hotY}); }); - if (g_pSeatManager->m_state.pointerFocus && g_pSeatManager->m_state.pointerFocus->client() == m_resource->client()) - sendEnter(g_pSeatManager->m_state.pointerFocus.lock(), {-1, -1} /* Coords don't really matter that much, they will be updated next move */); + auto surface = g_pSeatManager->m_state.pointerFocus.lock(); + + if (surface && surface->client() == m_resource->client()) + sendEnter(surface, {-1, -1}); } CWLPointerResource::~CWLPointerResource() { -- cgit v1.2.3