From 4eb1543337ff1002d9c2f74a54e761925332e2c7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B8rgen=20Lind?= Date: Wed, 27 Apr 2011 10:05:52 +0200 Subject: [PATCH] Lighthouse: use maybetopdata instead of creating topdata for all widgets (cherry picked from commit 873764aa3cfbbd87bbbb4f3224a7807d46a16fc7) --- src/gui/kernel/qplatformscreen_qpa.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qplatformscreen_qpa.cpp b/src/gui/kernel/qplatformscreen_qpa.cpp index c9f3dc6..4fd6896 100644 --- a/src/gui/kernel/qplatformscreen_qpa.cpp +++ b/src/gui/kernel/qplatformscreen_qpa.cpp @@ -84,12 +84,15 @@ QSize QPlatformScreen::physicalSize() const Q_GUI_EXPORT extern QWidgetPrivate *qt_widget_private(QWidget *widget); QPlatformScreen * QPlatformScreen::platformScreenForWidget(const QWidget *widget) { + int screenIndex = 0; QWidget *window = widget->window(); QWidgetPrivate *windowPrivate = qt_widget_private(window); - QTLWExtra * topData = windowPrivate->topData(); + QTLWExtra * topData = windowPrivate->maybeTopData(); + if (topData) + screenIndex = topData->screenIndex; QPlatformIntegration *integration = QApplicationPrivate::platformIntegration(); - return integration->screens()[topData->screenIndex]; + return integration->screens()[screenIndex]; } /*! -- 2.7.4