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();