summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qplatformscreen_qpa.cpp
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2011-04-27 10:05:52 +0200
committerSamuel Rødal <samuel.rodal@nokia.com>2011-04-28 15:39:20 +0200
commit4eb1543337ff1002d9c2f74a54e761925332e2c7 (patch)
tree15d876d3cd7da795747be0d63495ea0faca04a74 /src/gui/kernel/qplatformscreen_qpa.cpp
parent45272d5e458e0b118f340daa7e89b6180e6dd426 (diff)
Lighthouse: use maybetopdata instead of creating topdata for all
widgets (cherry picked from commit 873764aa3cfbbd87bbbb4f3224a7807d46a16fc7)
Diffstat (limited to 'src/gui/kernel/qplatformscreen_qpa.cpp')
-rw-r--r--src/gui/kernel/qplatformscreen_qpa.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/kernel/qplatformscreen_qpa.cpp b/src/gui/kernel/qplatformscreen_qpa.cpp
index c9f3dc6f34..4fd6896a95 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];
}
/*!