layershell: fix popup crash with nullptr mon (#13763)

This commit is contained in:
UjinT34 2026-03-17 21:59:44 +03:00 committed by Vaxry
parent 67d178083e
commit 02446f5079
Signed by: vaxry
GPG key ID: 665806380871D640

View file

@ -201,7 +201,7 @@ void CPopup::onMap() {
sendScale();
m_wlSurface->resource()->breadthfirst([PMONITOR](SP<CWLSurfaceResource> s, const Vector2D& offset, void* d) { s->enter(PMONITOR->m_self.lock()); }, nullptr);
if (!m_layerOwner.expired() && m_layerOwner->m_layer < ZWLR_LAYER_SHELL_V1_LAYER_TOP)
if (!m_layerOwner.expired() && m_layerOwner->m_layer < ZWLR_LAYER_SHELL_V1_LAYER_TOP && m_layerOwner->m_monitor)
g_pHyprOpenGL->markBlurDirtyForMonitor(g_pCompositor->getMonitorFromID(m_layerOwner->m_layer));
m_alpha->setConfig(g_pConfigManager->getAnimationPropertyConfig("fadePopupsIn"));
@ -253,7 +253,7 @@ void CPopup::onUnmap() {
m_subsurfaceHead.reset();
if (!m_layerOwner.expired() && m_layerOwner->m_layer < ZWLR_LAYER_SHELL_V1_LAYER_TOP)
if (!m_layerOwner.expired() && m_layerOwner->m_layer < ZWLR_LAYER_SHELL_V1_LAYER_TOP && m_layerOwner->m_monitor)
g_pHyprOpenGL->markBlurDirtyForMonitor(g_pCompositor->getMonitorFromID(m_layerOwner->m_layer));
// damage all children
@ -318,7 +318,7 @@ void CPopup::onCommit(bool ignoreSiblings) {
m_requestedReposition = false;
if (!m_layerOwner.expired() && m_layerOwner->m_layer < ZWLR_LAYER_SHELL_V1_LAYER_TOP)
if (!m_layerOwner.expired() && m_layerOwner->m_layer < ZWLR_LAYER_SHELL_V1_LAYER_TOP && m_layerOwner->m_monitor)
g_pHyprOpenGL->markBlurDirtyForMonitor(g_pCompositor->getMonitorFromID(m_layerOwner->m_layer));
}