QDialog::adjustPosition(): Check screen number
The screen number has been observed to be -1 in setups
with multiple virtual desktops.
Amends change eb50193136.
Task-number: QTBUG-52735
Change-Id: If01acf74fdd701a9211df732c0defdfd522ba72d
Reviewed-by: hjk <hjk@qt.io>
bb10
parent
7095db3633
commit
d57bfa21ce
|
|
@ -863,8 +863,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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue