From b5d0519ccdb5f6cdf015f21a91161321b3db63eb Mon Sep 17 00:00:00 2001 From: xxyangyoulin Date: Mon, 27 Apr 2026 20:22:34 +0800 Subject: desktop/view: fix SIGABRT in CWindow::onUnmap when monitor is expired (#14148) m_monitor is a WP (weak_ptr). In onUnmap(), calling m_monitor->activeWorkspaceID() without .lock() causes SIGABRT when the monitor has been destroyed before the XWayland unmap event arrives, e.g. when a window on a special workspace is unmapped. --- src/desktop/view/Window.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/desktop/view/Window.cpp') diff --git a/src/desktop/view/Window.cpp b/src/desktop/view/Window.cpp index 70ef2aae..53347722 100644 --- a/src/desktop/view/Window.cpp +++ b/src/desktop/view/Window.cpp @@ -576,8 +576,11 @@ void CWindow::onUnmap() { // if the special workspace now has 0 windows, it will be closed, and this // window will no longer pass render checks, cuz the workspace will be nuked. // throw it into the main one for the fadeout. - if (m_workspace->m_isSpecialWorkspace && m_workspace->getWindows() == 0) - m_lastWorkspace = m_monitor->activeWorkspaceID(); + if (m_workspace->m_isSpecialWorkspace && m_workspace->getWindows() == 0) { + const auto PMONITOR = m_monitor.lock(); + if (PMONITOR) + m_lastWorkspace = PMONITOR->activeWorkspaceID(); + } if (*PCLOSEONLASTSPECIAL && m_workspace && m_workspace->getWindows() == 0 && onSpecialWorkspace()) { const auto PMONITOR = m_monitor.lock(); -- cgit v1.2.3