summaryrefslogtreecommitdiff
path: root/src/desktop/LayerSurface.cpp
diff options
context:
space:
mode:
authorVirt <41426325+VirtCode@users.noreply.github.com>2024-07-29 10:47:25 +0200
committerGitHub <noreply@github.com>2024-07-29 09:47:25 +0100
commit6e6c61b9e87942425b978efa2309dbcca57c3217 (patch)
tree6ea36bc073a69f36c2d42a742faec36d8be640b5 /src/desktop/LayerSurface.cpp
parenta9d87bd6669568741704de08b6f0328a92e29396 (diff)
layer-shell: avoid crashes on unmap (#7092)
Diffstat (limited to 'src/desktop/LayerSurface.cpp')
-rw-r--r--src/desktop/LayerSurface.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/desktop/LayerSurface.cpp b/src/desktop/LayerSurface.cpp
index 3a3edc6d..4426491d 100644
--- a/src/desktop/LayerSurface.cpp
+++ b/src/desktop/LayerSurface.cpp
@@ -219,7 +219,7 @@ void CLayerSurface::onUnmap() {
// refocus if needed
// vvvvvvvvvvvvv if there is a last focus and the last focus is not keyboard focusable, fallback to window
- if (WASLASTFOCUS || (g_pCompositor->m_pLastFocus && !g_pCompositor->m_pLastFocus->hlSurface->keyboardFocusable()))
+ if (WASLASTFOCUS || (g_pCompositor->m_pLastFocus && g_pCompositor->m_pLastFocus->hlSurface && !g_pCompositor->m_pLastFocus->hlSurface->keyboardFocusable()))
g_pInputManager->refocusLastWindow(PMONITOR);
else if (g_pCompositor->m_pLastFocus)
g_pSeatManager->setKeyboardFocus(g_pCompositor->m_pLastFocus.lock());