diff --git a/applets/pager/plugin/windowmodel.cpp b/applets/pager/plugin/windowmodel.cpp --- a/applets/pager/plugin/windowmodel.cpp +++ b/applets/pager/plugin/windowmodel.cpp @@ -36,6 +36,7 @@ { public: Private(WindowModel *q); + QRect screenGeometry() const; PagerModel *pagerModel = nullptr; @@ -76,8 +77,7 @@ { if (role == AbstractTasksModel::Geometry) { QRect windowGeo = TaskFilterProxyModel::data(index, role).toRect(); - QList screens = QGuiApplication::screens(); - const QRect desktopGeo = screens.at(0)->geometry(); + const QRect desktopGeo = d->screenGeometry(); if (KWindowSystem::mapViewport()) { int x = windowGeo.center().x() % desktopGeo.width(); @@ -145,3 +145,12 @@ emit dataChanged(index(0, 0), index(rowCount() - 1, 0), QVector{StackingOrder}); } } + +QRect WindowModel::Private::screenGeometry() const +{ + QRegion geometry; + for (auto screen: qApp->screens()) { + geometry += screen->geometry(); + } + return geometry.boundingRect(); +}