From 8947ece98f2d262a887cf1e6fb049d694dc4a511 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Mon, 11 Apr 2022 11:18:30 +0000 Subject: [PATCH] Fix a crash on x11 on closing laptop lid On x11 when multiscreen is enabled often kwin crashes on laptop lid close, for two reasons: * m_outputLayer going dangling in RenderLayer: fixed by using a QPointer * m_activeOutput going dangling in Workspace For the latter, the output disabling was done correctly, but x11client did set the old deleted output again in X11Client::moveResizeInternal This is fixed by moving desktopResized() at the bottom of Workspace::slotOutputDisabled() after the reassign of outputs to the toplevels --- src/renderlayer.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/renderlayer.h b/src/renderlayer.h index db0a3ebcda..65ca9ac8fd 100644 --- a/src/renderlayer.h +++ b/src/renderlayer.h @@ -8,8 +8,11 @@ #include "kwin_export.h" +#include "outputlayer.h" + #include #include +#include #include namespace KWin @@ -84,7 +87,7 @@ private: QRegion m_repaints; QRect m_boundingRect; QRect m_geometry; - OutputLayer *m_outputLayer = nullptr; + QPointer m_outputLayer; RenderLayer *m_superlayer = nullptr; QList m_sublayers; bool m_effectiveVisible = true;