summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Hartmetz <andreas.hartmetz@kdab.com>2014-09-09 21:50:57 +0200
committerAndreas Hartmetz <ahartmetz@gmail.com>2014-09-11 23:14:25 +0200
commit33e7093a840ed349c0d579f267cc300a555d54e6 (patch)
treea6cee345d4afb74fd9dcf4f77d6fa99bc839a16d
parent294e65f8092dd5b624740ee39d52979c7ca6f387 (diff)
Set WINDOWPLACEMENT::length as required by the documentation.
Found this while debugging something else in Dr. Memory. Change-Id: Id295ddf4e07088684ecf91e3c2e0a156bf6054cb Reviewed-by: Andrew Knight <andrew.knight@digia.com>
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp2
1 files changed, 2 insertions, 0 deletions
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.