summaryrefslogtreecommitdiff
path: root/src/managers/input/InputManager.cpp
diff options
context:
space:
mode:
authorskrmc <70046367+skrmc@users.noreply.github.com>2025-12-31 08:00:11 -0500
committerGitHub <noreply@github.com>2025-12-31 14:00:11 +0100
commit214fdb099ca84435196a0f06c816835514c3e8e3 (patch)
treefb1475227676a8fa19b1eefe6653995d9d28798e /src/managers/input/InputManager.cpp
parentd622c09d09094eba49f6e219c81059ee0be548c2 (diff)
input: guard null `view()` when processing mouse down (#12772)
Diffstat (limited to 'src/managers/input/InputManager.cpp')
-rw-r--r--src/managers/input/InputManager.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index 73da6df4..7272e1cf 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -806,8 +806,10 @@ void CInputManager::processMouseDownNormal(const IPointer::SButtonEvent& e) {
auto HLSurf = Desktop::View::CWLSurface::fromResource(g_pSeatManager->m_state.pointerFocus.lock());
- if (HLSurf && HLSurf->view()->type() == Desktop::View::VIEW_TYPE_WINDOW)
- g_pCompositor->changeWindowZOrder(dynamicPointerCast<Desktop::View::CWindow>(HLSurf->view()), true);
+ // pointerFocus can target a surface without a Desktop::View (e.g. IME popups), so view() may be null.
+ const auto PVIEW = HLSurf ? HLSurf->view() : nullptr;
+ if (PVIEW && PVIEW->type() == Desktop::View::VIEW_TYPE_WINDOW)
+ g_pCompositor->changeWindowZOrder(dynamicPointerCast<Desktop::View::CWindow>(PVIEW), true);
break;
}