diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-07-28 13:24:55 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@qt.io> | 2017-08-02 21:07:36 +0000 |
commit | 0257ffe465d89a99f062c366bd7c7cd6d6826b4d (patch) | |
tree | 4d01b6e07157cb3020a7807c8dadcca7b34a7dc0 /src/plugins/platforms/windows | |
parent | 4bfff6a98b59b32605d881a463ad3edc221a7dc8 (diff) |
Windows QPA: Store requested geometry before QPlatformWindow::initialGeometry()
When requesting windows with a size of 0x0 for which a default size
is determined by QPlatformWindow::initialGeometry(),
QWindowsWindow::initialize() did not call handleGeometry() since
it compared against the requested geometry obtained after
calling QPlatformWindow::initialGeometry().
Store the initial geometry in the context.
Amends deb7f9a7c3b2044ef6d6253a3f836fe1837bde6e.
Task-number: QTBUG-62177
Task-number: QTBUG-61977
Change-Id: I9e96f2f0b984b9009bebb192f576c92b4409d5d1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows')
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 7 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.h | 10 |
2 files changed, 10 insertions, 7 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 6b737207f5..513bad35aa 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -640,7 +640,7 @@ QWindowsWindowData // Capture events before CreateWindowEx() returns. The context is cleared in // the QWindowsWindow constructor. - const QWindowCreationContextPtr context(new QWindowCreationContext(w, rect, data.customMargins, style, exStyle)); + const QWindowCreationContextPtr context(new QWindowCreationContext(w, data.geometry, rect, data.customMargins, style, exStyle)); QWindowsContext::instance()->setWindowCreationContext(context); qCDebug(lcQpaWindows).nospace() @@ -1004,10 +1004,11 @@ void QWindowsForeignWindow::setVisible(bool visible) */ QWindowCreationContext::QWindowCreationContext(const QWindow *w, - const QRect &geometry, + const QRect &geometryIn, const QRect &geometry, const QMargins &cm, DWORD style_, DWORD exStyle_) : geometryHint(w, cm), window(w), style(style_), exStyle(exStyle_), + requestedGeometryIn(geometryIn), requestedGeometry(geometry), obtainedGeometry(geometry), margins(QWindowsGeometryHint::frame(style, exStyle)), customMargins(cm) { @@ -1122,7 +1123,7 @@ void QWindowsWindow::initialize() if (w->type() != Qt::Desktop) { const Qt::WindowState state = w->windowState(); if (state != Qt::WindowMaximized && state != Qt::WindowFullScreen - && creationContext->requestedGeometry != creationContext->obtainedGeometry) { + && creationContext->requestedGeometryIn != creationContext->obtainedGeometry) { QWindowSystemInterface::handleGeometryChange(w, creationContext->obtainedGeometry); } QPlatformScreen *obtainedScreen = screenForGeometry(creationContext->obtainedGeometry); diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h index 60289bdc08..3308dfb239 100644 --- a/src/plugins/platforms/windows/qwindowswindow.h +++ b/src/plugins/platforms/windows/qwindowswindow.h @@ -81,9 +81,10 @@ struct QWindowsGeometryHint struct QWindowCreationContext { - QWindowCreationContext(const QWindow *w, const QRect &r, - const QMargins &customMargins, - DWORD style, DWORD exStyle); + explicit QWindowCreationContext(const QWindow *w, + const QRect &geometryIn, const QRect &geometry, + const QMargins &customMargins, + DWORD style, DWORD exStyle); void applyToMinMaxInfo(MINMAXINFO *mmi) const { geometryHint.applyToMinMaxInfo(style, exStyle, mmi); } @@ -91,7 +92,8 @@ struct QWindowCreationContext const QWindow *window; DWORD style; DWORD exStyle; - QRect requestedGeometry; + QRect requestedGeometryIn; // QWindow scaled + QRect requestedGeometry; // after QPlatformWindow::initialGeometry() QRect obtainedGeometry; QMargins margins; QMargins customMargins; // User-defined, additional frame for WM_NCCALCSIZE |