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 <miikka.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
bb10
Andreas Holzammer 2012-07-19 10:07:00 +02:00 committed by Qt by Nokia
parent 784a877d3c
commit 917ef57874
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -125,7 +125,8 @@ public:
BlockedByModal = 0x80,
SizeGripOperation = 0x100,
FrameStrutEventsEnabled = 0x200,
SynchronousGeometryChangeEvent = 0x400
SynchronousGeometryChangeEvent = 0x400,
WithinSetStyle = 0x800
};
struct WindowData