Windows QPA: Fix wrong initial size when launched on secondary screen
Send changed events from QPlatformWindow::initialize() synchronously so a protentially changed screen takes effect in QWindow::resize() called by QWidget::show_sys(). Task-number: QTBUG-67777 Change-Id: I889500d458caf0e782bdbc237ce790f0b0bc2d95 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This commit is contained in:
parent
ae8743bf86
commit
b145201128
@ -1144,11 +1144,11 @@ void QWindowsWindow::initialize()
|
|||||||
const Qt::WindowState state = w->windowState();
|
const Qt::WindowState state = w->windowState();
|
||||||
if (state != Qt::WindowMaximized && state != Qt::WindowFullScreen
|
if (state != Qt::WindowMaximized && state != Qt::WindowFullScreen
|
||||||
&& creationContext->requestedGeometryIn != creationContext->obtainedGeometry) {
|
&& creationContext->requestedGeometryIn != creationContext->obtainedGeometry) {
|
||||||
QWindowSystemInterface::handleGeometryChange(w, creationContext->obtainedGeometry);
|
QWindowSystemInterface::handleGeometryChange<QWindowSystemInterface::SynchronousDelivery>(w, creationContext->obtainedGeometry);
|
||||||
}
|
}
|
||||||
QPlatformScreen *obtainedScreen = screenForGeometry(creationContext->obtainedGeometry);
|
QPlatformScreen *obtainedScreen = screenForGeometry(creationContext->obtainedGeometry);
|
||||||
if (obtainedScreen && screen() != obtainedScreen)
|
if (obtainedScreen && screen() != obtainedScreen)
|
||||||
QWindowSystemInterface::handleWindowScreenChanged(w, obtainedScreen->screen());
|
QWindowSystemInterface::handleWindowScreenChanged<QWindowSystemInterface::SynchronousDelivery>(w, obtainedScreen->screen());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user