Update struts on screen size change

Calls updateStruts on KScreen::Screen::currentSizeChanged instead of
KScreen::Config::outputAdded/outputRemoved.
When an output is (dis)conencted, it isn't added/removed, it is mearly
marked as (dis)connected. Therefore, updating struts on
outputAdded/outputRemoved doesn't work.

BUG: 349400
REVIEW: 124996
wilder-5.14
Andrew Chen 11 years ago committed by David Edmundson
parent 98e63f95e7
commit d66d6d57d3
  1. 11
      shell/panelview.cpp

@ -106,14 +106,9 @@ PanelView::PanelView(ShellCorona *corona, QScreen *targetScreen, QWindow *parent
m_strutsTimer.setSingleShot(true);
connect(&m_strutsTimer, &QTimer::timeout,
this, &PanelView::updateStruts);
connect(m_corona->screensConfiguration().data(), &KScreen::Config::outputAdded,
this, [this] (const KScreen::OutputPtr &) {
updateStruts();
});
connect(m_corona->screensConfiguration().data(), &KScreen::Config::outputRemoved,
this, [this] (int) {
updateStruts();
});
connect(m_corona->screensConfiguration()->screen().data(), &KScreen::Screen::currentSizeChanged,
this, &PanelView::updateStruts);
qmlRegisterType<QScreen>();
engine()->rootContext()->setContextProperty("panel", this);

Loading…
Cancel
Save