diff options
| author | xxyangyoulin <xxyangyoulin@gmail.com> | 2026-04-27 20:22:34 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-27 13:22:34 +0100 |
| commit | b5d0519ccdb5f6cdf015f21a91161321b3db63eb (patch) | |
| tree | 84a000f293ac01138c375859169c0e36e1cb1d13 /src | |
| parent | 80763b13ff9b8abb94654d9f5ca635003c0b5d84 (diff) | |
desktop/view: fix SIGABRT in CWindow::onUnmap when monitor is expired (#14148)
m_monitor is a WP<CMonitor> (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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/desktop/view/Window.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
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(); |
