From cfe95aa746894d604b99e25ceaac689a9863c9ae Mon Sep 17 00:00:00 2001 From: Andreas Holzammer Date: Mon, 16 Jul 2012 14:58:00 +0200 Subject: Fix window size issue under Windows CE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/qwindowswindow.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 6ef85cd49a..184669d0a5 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -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), -- cgit v1.2.3