diff options
Diffstat (limited to 'src/widgets/dialogs')
-rw-r--r-- | src/widgets/dialogs/qdialog.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp index 8f3072e41c..bfc943966f 100644 --- a/src/widgets/dialogs/qdialog.cpp +++ b/src/widgets/dialogs/qdialog.cpp @@ -874,8 +874,10 @@ void QDialog::adjustPosition(QWidget* w) // 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)); + if (scrn >= 0) { + if (QWindow *window = windowHandle()) + window->setScreen(QGuiApplication::screens().at(scrn)); + } move(p); } |