Commit 26ac36e2 authored by Marco Martin's avatar Marco Martin
Browse files

fire adaptToScreen only once

this makes the desktops and panels more deterministically
follow the primary screen
* adaptToScreen is useless per se in moveEvent, but what's worse will cause a recursion loop
* disconnect the geometry sync from the old screen

CCBUG:335710
parent 1316d115
......@@ -86,12 +86,6 @@ void DesktopView::setFillScreen(bool fillScreen)
emit fillScreenChanged();
}
void DesktopView::moveEvent(QMoveEvent* ev)
{
adaptToScreen();
QWindow::moveEvent(ev);
}
void DesktopView::adaptToScreen()
{
//This happens sometimes, when shutting down the process
......@@ -102,11 +96,16 @@ void DesktopView::adaptToScreen()
setGeometry(screen()->geometry());
setMinimumSize(screen()->geometry().size());
setMaximumSize(screen()->geometry().size());
disconnect(m_oldScreen.data(), &QScreen::geometryChanged, this, static_cast<void (QWindow::*)(const QRect&)>(&QWindow::setGeometry));
connect(screen(), &QScreen::geometryChanged, this, static_cast<void (QWindow::*)(const QRect&)>(&QWindow::setGeometry), Qt::UniqueConnection);
} else {
disconnect(screen(), &QScreen::geometryChanged, this, static_cast<void (QWindow::*)(const QRect&)>(&QWindow::setGeometry));
}
// qDebug() << "adapted" << geometry() << (containment () ? containment()->wallpaper() : "xx");
m_oldScreen = screen();
qDebug() << "adapted" << geometry() << (containment () ? containment()->wallpaper() : "xx");
}
void DesktopView::ensureStayBehind()
......
......@@ -63,9 +63,9 @@ Q_SIGNALS:
private:
void coronaPackageChanged(const Plasma::Package &package);
void ensureStayBehind();
virtual void moveEvent(QMoveEvent* ev);
QPointer<PlasmaQuick::ConfigView> m_configView;
QPointer<QScreen> m_oldScreen;
bool m_stayBehind : 1;
bool m_fillScreen : 1;
bool m_dashboardShown : 1;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment