From 5212099b9f115932b84bcdb8c29b536f5ce385e4 Mon Sep 17 00:00:00 2001 From: Tom Englund Date: Thu, 25 Sep 2025 15:30:04 +0200 Subject: [PATCH] layout: avoid nullptr deref (#11831) OPENINGON can be a nullptr and that makes FLOATEDINTOTILED to nullptr deref and segfault. --- src/layout/IHyprLayout.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp index 464825c4..e21cd886 100644 --- a/src/layout/IHyprLayout.cpp +++ b/src/layout/IHyprLayout.cpp @@ -206,7 +206,7 @@ bool IHyprLayout::onWindowCreatedAutoGroup(PHLWINDOW pWindow) { const PHLWINDOW OPENINGON = g_pCompositor->m_lastWindow.lock() && g_pCompositor->m_lastWindow->m_workspace == pWindow->m_workspace ? g_pCompositor->m_lastWindow.lock() : (pWindow->m_workspace ? pWindow->m_workspace->getFirstWindow() : nullptr); - const bool FLOATEDINTOTILED = pWindow->m_isFloating && !OPENINGON->m_isFloating; + const bool FLOATEDINTOTILED = pWindow->m_isFloating && OPENINGON && !OPENINGON->m_isFloating; const bool SWALLOWING = pWindow->m_swallowed || pWindow->m_groupSwallowed; if ((*PAUTOGROUP || SWALLOWING) // continue if auto_group is enabled or if dealing with window swallowing.