1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-01-12 01:17:55 +03:00

support plasmoid.screenGeometry properly

BUG: 401333
This commit is contained in:
Michail Vourlakos 2018-11-23 16:57:33 +02:00
parent 6c58115f9b
commit 8294bd892c
2 changed files with 23 additions and 1 deletions

View File

@ -221,6 +221,15 @@ void DockCorona::load()
}
m_layoutManager->loadLayoutOnStartup(loadLayoutName);
//! load screens signals such screenGeometryChanged in order to support
//! plasmoid.screenGeometry properly
for (QScreen *screen : qGuiApp->screens()) {
addOutput(screen);
}
connect(qGuiApp, &QGuiApplication::screenAdded, this, &DockCorona::addOutput, Qt::UniqueConnection);
}
}
@ -608,6 +617,19 @@ void DockCorona::addOutput(QScreen *screen)
int newId = m_screenPool->firstAvailableId();
m_screenPool->insertScreenMapping(newId, screen->name());
}
connect(screen, &QScreen::geometryChanged, this, [ = ]() {
const int id = m_screenPool->id(screen->name());
if (id >= 0) {
emit screenGeometryChanged(id);
emit availableScreenRegionChanged();
emit availableScreenRectChanged();
}
});
emit availableScreenRectChanged();
emit screenAdded(m_screenPool->id(screen->name()));
}
void DockCorona::primaryOutputChanged()

View File

@ -659,7 +659,7 @@ Item {
id: tasksModel
virtualDesktop: virtualDesktopInfo.currentDesktop
screenGeometry: latteDock ? latteDock.screenGeometry : plasmoid.screenGeometry
screenGeometry: plasmoid.screenGeometry
// comment in order to support LTS Plasma 5.8
// screen: plasmoid.screen
activity: activityInfo.currentActivity