input: guard null view() when processing mouse down (#12772)
This commit is contained in:
parent
d622c09d09
commit
214fdb099c
1 changed files with 4 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue