Fix window size issue under Windows CE
authorAndreas Holzammer <andreas.holzammer@kdab.com>
Mon, 16 Jul 2012 12:58:00 +0000 (14:58 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 16 Jul 2012 14:30:55 +0000 (16:30 +0200)
Under Windows CE the top title window bar needs
to be taken into account when creating a window,
so the Style WS_OVERLAPPED needs to be passed to
AdjustWindowRectEx, to get the right size of the
window. For the desktop the documentation says,
that you should not pass the WS_OVERLAPPED flag,
but wince does not talk about this.

Change-Id: Id8c9d28b7aa04a9920e4cb81ac11463d9717a0e7
Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
src/plugins/platforms/windows/qwindowswindow.cpp

index 6ef85cd..184669d 100644 (file)
@@ -553,7 +553,9 @@ bool QWindowsGeometryHint::validSize(const QSize &s) const
 QMargins QWindowsGeometryHint::frame(DWORD style, DWORD exStyle)
 {
     RECT rect = {0,0,0,0};
+#ifndef Q_OS_WINCE
     style &= ~(WS_OVERLAPPED); // Not permitted, see docs.
+#endif
     if (!AdjustWindowRectEx(&rect, style, FALSE, exStyle))
         qErrnoWarning("%s: AdjustWindowRectEx failed", __FUNCTION__);
     const QMargins result(qAbs(rect.left), qAbs(rect.top),