Lighthouse: Fix virtual desktopwidget

(cherry picked from commit 69c759f5b84c2f6a44377e5f72cfe9d5bf7344c6)
This commit is contained in:
Jørgen Lind 2011-04-20 09:17:13 +02:00 committed by Paul Olav Tvete
parent e443d88501
commit 64fa65df74
2 changed files with 4 additions and 9 deletions

View File

@ -51,6 +51,8 @@ QT_USE_NAMESPACE
void QDesktopWidgetPrivate::updateScreenList() void QDesktopWidgetPrivate::updateScreenList()
{ {
Q_Q(QDesktopWidget);
QList<QPlatformScreen *> screenList = QApplicationPrivate::platformIntegration()->screens(); QList<QPlatformScreen *> screenList = QApplicationPrivate::platformIntegration()->screens();
int targetLength = screenList.length(); int targetLength = screenList.length();
int currentLength = screens.length(); int currentLength = screens.length();
@ -72,19 +74,15 @@ void QDesktopWidgetPrivate::updateScreenList()
} }
QRegion virtualGeometry; QRegion virtualGeometry;
bool doVirtualGeometry = QApplicationPrivate::platformIntegration()->isVirtualDesktop();
// update the geometry of each screen widget // update the geometry of each screen widget
for (int i = 0; i < screens.length(); i++) { for (int i = 0; i < screens.length(); i++) {
QRect screenGeometry = screenList.at(i)->geometry(); QRect screenGeometry = screenList.at(i)->geometry();
screens.at(i)->setGeometry(screenGeometry); screens.at(i)->setGeometry(screenGeometry);
if (doVirtualGeometry)
virtualGeometry += screenGeometry; virtualGeometry += screenGeometry;
} }
virtualScreen.setGeometry(virtualGeometry.boundingRect()); q->setGeometry(virtualGeometry.boundingRect());
Q_Q(QDesktopWidget);
q->setGeometry(virtualScreen.geometry());
} }
QDesktopWidget::QDesktopWidget() QDesktopWidget::QDesktopWidget()
@ -118,8 +116,6 @@ int QDesktopWidget::numScreens() const
QWidget *QDesktopWidget::screen(int screen) QWidget *QDesktopWidget::screen(int screen)
{ {
Q_D(QDesktopWidget); Q_D(QDesktopWidget);
if (QApplicationPrivate::platformIntegration()->isVirtualDesktop())
return &d->virtualScreen;
if (screen < 0 || screen >= d->screens.length()) if (screen < 0 || screen >= d->screens.length())
return d->screens.at(0); return d->screens.at(0);
return d->screens.at(screen); return d->screens.at(screen);

View File

@ -76,7 +76,6 @@ public:
void updateScreenList(); void updateScreenList();
QList<QDesktopScreenWidget *> screens; QList<QDesktopScreenWidget *> screens;
QDesktopScreenWidget virtualScreen;
}; };
#endif // QDESKTOPWIDGET_QPA_P_H #endif // QDESKTOPWIDGET_QPA_P_H