From 97a181cd7911eb0249997d857ddd5a0bb29143ee Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Tue, 6 May 2014 19:11:13 +0200 Subject: [PATCH] Don't adapt to the new screen if it's null --- shell/desktopview.cpp | 6 ++++++ shell/panelview.cpp | 2 ++ 2 files changed, 8 insertions(+) diff --git a/shell/desktopview.cpp b/shell/desktopview.cpp index e3485e57a..5fc33596f 100644 --- a/shell/desktopview.cpp +++ b/shell/desktopview.cpp @@ -91,6 +91,9 @@ void DesktopView::moveEvent(QMoveEvent* ev) void DesktopView::adaptToScreen() { + //This happens sometimes, when shutting down the process + if (!screen()) + return; qDebug() << "adapting to screen" << screen()->name() << this; if (m_fillScreen) { setGeometry(screen()->geometry()); @@ -105,6 +108,9 @@ void DesktopView::adaptToScreen() void DesktopView::ensureStayBehind() { + //This happens sometimes, when shutting down the process + if (!screen()) + return; if (m_stayBehind) { KWindowSystem::setType(winId(), NET::Desktop); } else { diff --git a/shell/panelview.cpp b/shell/panelview.cpp index d66472456..07021dda7 100644 --- a/shell/panelview.cpp +++ b/shell/panelview.cpp @@ -103,6 +103,8 @@ PanelView::PanelView(Plasma::Containment *cont, QWindow *parent) //When the screen is set, the screen is recreated internally, so we need to //set anything that depends on the winId() connect(this, &QWindow::screenChanged, this, [=]() { + if (!screen()) + return; KWindowSystem::setType(winId(), NET::Dock); setVisibilityMode(m_visibilityMode); showTemporarily();