diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2011-10-26 16:09:37 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-26 18:06:39 +0200 |
commit | 82d6518696cdfeec88b7bdbffccc5b1521c18785 (patch) | |
tree | 403e4ade6903e84bca35a666315c04e198f516aa /src/plugins/platforms/windows/qwindowswindow.cpp | |
parent | a144e0bfdc9d5e98e718e8d60bcb016ca666a454 (diff) |
Windows: Fix Open GL formats.
- Add swapInterval as additional format
- Query context format correctly and store in separate struct
(default vs requested/obtained)
- Cosmetics, rename enumerations, structs.
Change-Id: I381cf8e1bde33e6624feb549437c7b95dd85e93c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowswindow.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 4b03fe6c9e..ef5c2ae246 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -617,7 +617,7 @@ QWindowsWindow::QWindowsWindow(QWindow *aWindow, const WindowData &data) : m_dropTarget(0) { if (aWindow->surfaceType() == QWindow::OpenGLSurface) - setFlag(OpenGL_Surface); + setFlag(OpenGLSurface); QWindowsContext::instance()->addWindow(m_data.hwnd, this); if (aWindow->isTopLevel()) { switch (aWindow->windowType()) { @@ -779,9 +779,14 @@ void QWindowsWindow::setParent_sys(const QPlatformWindow *parent) const parentHWND = parentW->handle(); } + const bool wasTopLevel = window()->isTopLevel(); const bool isTopLevel = parentHWND == 0; + + setFlag(WithinSetParent); SetParent(m_data.hwnd, parentHWND); + clearFlag(WithinSetParent); + // WS_CHILD/WS_POPUP must be manually set/cleared in addition // to dialog frames, etc (see SetParent() ) if the top level state changes. if (wasTopLevel != isTopLevel) { @@ -841,7 +846,8 @@ void QWindowsWindow::setGeometry(const QRect &rect) void QWindowsWindow::handleMoved() { - if (!IsIconic(m_data.hwnd)) // Minimize can send nonsensical move events. + // Minimize/Set parent can send nonsensical move events. + if (!IsIconic(m_data.hwnd) && !testFlag(WithinSetParent)) handleGeometryChange(); } @@ -940,7 +946,7 @@ void QWindowsWindow::handleWmPaint(HWND hwnd, UINT, WPARAM, LPARAM) { PAINTSTRUCT ps; - if (testFlag(OpenGL_Surface)) { + if (testFlag(OpenGLSurface)) { BeginPaint(hwnd, &ps); // WM_ERASEBKGND needs to be handled. EndPaint(hwnd, &ps); } else { |