summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2016-04-26 14:33:17 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2016-05-31 11:27:31 +0000
commiteb50193136c7c73be864e3232d01e98ddc24e539 (patch)
treea489ed47d83f6f60737bb1f2dc7d581fb87fd2de /src/widgets
parent2f0ffba638bdb868a810bc0349c240b6b6e172cd (diff)
QDialog::adjustPosition(): Manually set target screen before moving.
QDialog::adjustPosition() can move the dialog across screens. A call to QWindow::resize() later in the show sequence might then see the wrong scaling factor if the screen changed notification is still stuck in an event queue. Prevent that by setting the target screen early on. Task-number: QTBUG-52735 Change-Id: I17bb3490b660f8f17c36524457cb87adbb7851e9 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/dialogs/qdialog.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp
index 5124960ab4..45d2279ed5 100644
--- a/src/widgets/dialogs/qdialog.cpp
+++ b/src/widgets/dialogs/qdialog.cpp
@@ -860,6 +860,12 @@ void QDialog::adjustPosition(QWidget* w)
if (p.y() < desk.y())
p.setY(desk.y());
+ // QTBUG-52735: Manually set the correct target screen since scaling in a
+ // subsequent call to QWindow::resize() may otherwise use the wrong factor
+ // if the screen changed notification is still in an event queue.
+ if (QWindow *window = windowHandle())
+ window->setScreen(QGuiApplication::screens().at(scrn));
+
move(p);
}