From 43527d363472b52f17dd9f9f4f87ec25cbf8a399 Mon Sep 17 00:00:00 2001 From: Hiroki Tagato Date: Fri, 14 Nov 2025 07:06:34 +0900 Subject: [PATCH] internal: fix crash at startup on FreeBSD (#12298) Hyprland at the latest commit crashes at starting up on FreeBSD with SIGSEGV. Checking the validity of g_pXWayland->m_wm before calling updateWorkArea() appears to fix the issue. --- src/Compositor.cpp | 2 ++ src/layout/DwindleLayout.cpp | 2 ++ src/layout/MasterLayout.cpp | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 2dc798e4..702ed896 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -3029,6 +3029,8 @@ void CCompositor::arrangeMonitors() { #ifndef NO_XWAYLAND CBox box = g_pCompositor->calculateX11WorkArea(); + if (!g_pXWayland || !g_pXWayland->m_wm) + return; g_pXWayland->m_wm->updateWorkArea(box.x, box.y, box.w, box.h); #endif } diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index e46a0963..6df54445 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -601,6 +601,8 @@ void CHyprDwindleLayout::recalculateMonitor(const MONITORID& monid) { #ifndef NO_XWAYLAND CBox box = g_pCompositor->calculateX11WorkArea(); + if (!g_pXWayland || !g_pXWayland->m_wm) + return; g_pXWayland->m_wm->updateWorkArea(box.x, box.y, box.w, box.h); #endif } diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp index b40c339a..5dde65d6 100644 --- a/src/layout/MasterLayout.cpp +++ b/src/layout/MasterLayout.cpp @@ -297,6 +297,8 @@ void CHyprMasterLayout::recalculateMonitor(const MONITORID& monid) { #ifndef NO_XWAYLAND CBox box = g_pCompositor->calculateX11WorkArea(); + if (!g_pXWayland || !g_pXWayland->m_wm) + return; g_pXWayland->m_wm->updateWorkArea(box.x, box.y, box.w, box.h); #endif }