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() void DesktopView::adaptToScreen()
{ {
//This happens sometimes, when shutting down the process
if (!screen())
return;
qDebug() << "adapting to screen" << screen()->name() << this; qDebug() << "adapting to screen" << screen()->name() << this;
if (m_fillScreen) { if (m_fillScreen) {
setGeometry(screen()->geometry()); setGeometry(screen()->geometry());
@ -105,6 +108,9 @@ void DesktopView::adaptToScreen()
void DesktopView::ensureStayBehind() void DesktopView::ensureStayBehind()
{ {
//This happens sometimes, when shutting down the process
if (!screen())
return;
if (m_stayBehind) { if (m_stayBehind) {
KWindowSystem::setType(winId(), NET::Desktop); KWindowSystem::setType(winId(), NET::Desktop);
} else { } 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 //When the screen is set, the screen is recreated internally, so we need to
//set anything that depends on the winId() //set anything that depends on the winId()
connect(this, &QWindow::screenChanged, this, [=]() { connect(this, &QWindow::screenChanged, this, [=]() {
if (!screen())
return;
KWindowSystem::setType(winId(), NET::Dock); KWindowSystem::setType(winId(), NET::Dock);
setVisibilityMode(m_visibilityMode); setVisibilityMode(m_visibilityMode);
showTemporarily(); showTemporarily();

Loading…
Cancel
Save