From 33e7093a840ed349c0d579f267cc300a555d54e6 Mon Sep 17 00:00:00 2001 From: Andreas Hartmetz Date: Tue, 9 Sep 2014 21:50:57 +0200 Subject: [PATCH] Set WINDOWPLACEMENT::length as required by the documentation. Found this while debugging something else in Dr. Memory. Change-Id: Id295ddf4e07088684ecf91e3c2e0a156bf6054cb Reviewed-by: Andrew Knight --- src/plugins/platforms/windows/qwindowswindow.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 672d169984..a61d1524c4 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -185,6 +185,7 @@ static inline QRect frameGeometry(HWND hwnd, bool topLevel) #ifndef Q_OS_WINCE if (topLevel) { WINDOWPLACEMENT windowPlacement; + windowPlacement.length = sizeof(WINDOWPLACEMENT); GetWindowPlacement(hwnd, &windowPlacement); if (windowPlacement.showCmd == SW_SHOWMINIMIZED) return qrectFromRECT(windowPlacement.rcNormalPosition); @@ -1418,6 +1419,7 @@ void QWindowsWindow::setGeometry_sys(const QRect &rect) const bool result = false; #ifndef Q_OS_WINCE WINDOWPLACEMENT windowPlacement; + windowPlacement.length = sizeof(WINDOWPLACEMENT); GetWindowPlacement(m_data.hwnd, &windowPlacement); // If the window is hidden and in maximized state or minimized, instead of moving the // window, set the normal position of the window.