diff options
| author | Visal Vijay <150381094+B2krobbery@users.noreply.github.com> | 2026-04-01 18:59:37 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-01 14:29:37 +0100 |
| commit | 7fbf8f98477dfbb2e6b193ef85e0c2d119d3fe80 (patch) | |
| tree | 49a704a4c384cfccdfbaf16a5d5f920810370bf2 /src/protocols | |
| parent | 36f184ead8120a18cce4e70ae09eddcf331b7833 (diff) | |
seat: store surface in pointerFocus before sendEnter (#13941)
ptr could expire
Diffstat (limited to 'src/protocols')
| -rw-r--r-- | src/protocols/core/Seat.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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<CWlPointer> resource_, SP<CWLSeatResou g_pSeatManager->onSetCursor(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() { |
