From 917ef5787444403ce0f7f035e27b1740c7672e34 Mon Sep 17 00:00:00 2001 From: Andreas Holzammer Date: Thu, 19 Jul 2012 10:07:00 +0200 Subject: Don't update geometry while the style is set Under Windows CE a resize event gets fired when the style is set, this will produce geometry change events inside Qt, which will end up in changing the geometry back and forth. Change-Id: I7f834997abc53760ccfe2ad97012bb74dc5c705c Reviewed-by: Miikka Heikkinen Reviewed-by: Friedemann Kleint Reviewed-by: Joerg Bornemann --- src/plugins/platforms/windows/qwindowswindow.cpp | 5 +++++ src/plugins/platforms/windows/qwindowswindow.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 96c2bc08e9..9d15240350 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -991,6 +991,9 @@ void QWindowsWindow::handleResized(int wParam) void QWindowsWindow::handleGeometryChange() { + //Prevent recursive resizes for Windows CE + if (testFlag(WithinSetStyle)) + return; m_data.geometry = geometry_sys(); QPlatformWindow::setGeometry(m_data.geometry); if (testFlag(SynchronousGeometryChangeEvent)) @@ -1295,8 +1298,10 @@ void QWindowsWindow::setStyle(unsigned s) const { if (QWindowsContext::verboseWindows) qDebug() << __FUNCTION__ << this << window() << debugWinStyle(s); + setFlag(WithinSetStyle); setFlag(FrameDirty); SetWindowLongPtr(m_data.hwnd, GWL_STYLE, s); + clearFlag(WithinSetStyle); } void QWindowsWindow::setExStyle(unsigned s) const diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h index b2b33302f6..b45b00b434 100644 --- a/src/plugins/platforms/windows/qwindowswindow.h +++ b/src/plugins/platforms/windows/qwindowswindow.h @@ -125,7 +125,8 @@ public: BlockedByModal = 0x80, SizeGripOperation = 0x100, FrameStrutEventsEnabled = 0x200, - SynchronousGeometryChangeEvent = 0x400 + SynchronousGeometryChangeEvent = 0x400, + WithinSetStyle = 0x800 }; struct WindowData -- cgit v1.2.3