summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qplatformintegration.cpp
diff options
context:
space:
mode:
authorSandro Mani <manisandro@gmail.com>2015-02-02 17:14:40 +0100
committerShawn Rutledge <shawn.rutledge@digia.com>2015-02-25 12:15:05 +0000
commit52f5e50f11a3ba82e32dc2efc656e4021a3fa4f5 (patch)
tree7c77a6e56d24ea1a34cc963546dad12ace95f3de /src/gui/kernel/qplatformintegration.cpp
parentdf39295f23c7d9ead8481a95b9c78caaff1e8bc8 (diff)
Ensure QGuiApplicationPrivate::screen_list is correctly populated
Ensure QGuiApplicationPrivate::screen_list always contains at least one screen, and that the first item (returned by QGuiApplication::primaryScreen) is always the current primary screen Task-number: QTBUG-42985 Change-Id: I08b880b3e94387f28230ed5fc738bceea943bad3 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Diffstat (limited to 'src/gui/kernel/qplatformintegration.cpp')
-rw-r--r--src/gui/kernel/qplatformintegration.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp
index d2db6af52b..6043ae0cfd 100644
--- a/src/gui/kernel/qplatformintegration.cpp
+++ b/src/gui/kernel/qplatformintegration.cpp
@@ -443,11 +443,15 @@ QList<int> QPlatformIntegration::possibleKeys(const QKeyEvent *) const
The screen should be deleted by calling QPlatformIntegration::destroyScreen().
*/
-void QPlatformIntegration::screenAdded(QPlatformScreen *ps)
+void QPlatformIntegration::screenAdded(QPlatformScreen *ps, bool isPrimary)
{
QScreen *screen = new QScreen(ps);
ps->d_func()->screen = screen;
- QGuiApplicationPrivate::screen_list << screen;
+ if (isPrimary) {
+ QGuiApplicationPrivate::screen_list.prepend(screen);
+ } else {
+ QGuiApplicationPrivate::screen_list.append(screen);
+ }
emit qGuiApp->screenAdded(screen);
}