Don't adapt to the new screen if it's null

wilder-5.14
Aleix Pol 12 years ago
parent 8e14def8ec
commit 97a181cd79
  1. 6
      shell/desktopview.cpp
  2. 2
      shell/panelview.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 {

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

Loading…
Cancel
Save