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.
This commit is contained in:
Hiroki Tagato 2025-11-14 07:06:34 +09:00 committed by Vaxry
parent 9008835c0f
commit a75f4283d4
Signed by: vaxry
GPG key ID: 665806380871D640
3 changed files with 6 additions and 0 deletions

View file

@ -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
}

View file

@ -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
}

View file

@ -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
}