summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowswindow.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-05-06 16:19:14 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-05-06 16:50:03 +0200
commit1326cd15f7ba985551f0fddc717e3bfc01ddda85 (patch)
tree024eb871ed5f4e8c02e21412475e6e9929a2b030 /src/plugins/platforms/windows/qwindowswindow.cpp
parentfe70367fe06984d1ac84cc276ca3fd3edc4193c7 (diff)
parentbeb7258a56b6ec76531b73cc07ee30132a3f548f (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: mkspecs/qnx-x86-qcc/qplatformdefs.h src/corelib/global/qglobal.h src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp src/opengl/qgl.cpp src/opengl/qglpixelbuffer.cpp src/opengl/qglshaderprogram.cpp tests/auto/opengl/qglthreads/tst_qglthreads.cpp Change-Id: Iaba137884d3526a139000ca26fee02bb27b5cdb5
Diffstat (limited to 'src/plugins/platforms/windows/qwindowswindow.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 00229a7540..2a221e71ca 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -886,7 +886,7 @@ QWindowsWindow::QWindowsWindow(QWindow *aWindow, const QWindowsWindowData &data)
if (aWindow->surfaceType() == QWindow::OpenGLSurface) {
setFlag(OpenGLSurface);
#if defined(QT_OPENGL_ES_2) || defined(QT_OPENGL_DYNAMIC)
- if (QOpenGLContext::openGLModuleType() != QOpenGLContext::DesktopGL)
+ if (QOpenGLContext::openGLModuleType() != QOpenGLContext::LibGL)
setFlag(OpenGL_ES2);
#endif
}
@@ -1022,17 +1022,17 @@ QWindow *QWindowsWindow::topLevelOf(QWindow *w)
while (QWindow *parent = w->parent())
w = parent;
- const QWindowsWindow *ww = static_cast<const QWindowsWindow *>(w->handle());
-
- // In case the topmost parent is embedded, find next ancestor using native methods
- if (ww->isEmbedded(0)) {
- HWND parentHWND = GetAncestor(ww->handle(), GA_PARENT);
- const HWND desktopHwnd = GetDesktopWindow();
- const QWindowsContext *ctx = QWindowsContext::instance();
- while (parentHWND && parentHWND != desktopHwnd) {
- if (QWindowsWindow *ancestor = ctx->findPlatformWindow(parentHWND))
- return topLevelOf(ancestor->window());
- parentHWND = GetAncestor(parentHWND, GA_PARENT);
+ if (const QPlatformWindow *handle = w->handle()) {
+ const QWindowsWindow *ww = static_cast<const QWindowsWindow *>(handle);
+ if (ww->isEmbedded(0)) {
+ HWND parentHWND = GetAncestor(ww->handle(), GA_PARENT);
+ const HWND desktopHwnd = GetDesktopWindow();
+ const QWindowsContext *ctx = QWindowsContext::instance();
+ while (parentHWND && parentHWND != desktopHwnd) {
+ if (QWindowsWindow *ancestor = ctx->findPlatformWindow(parentHWND))
+ return topLevelOf(ancestor->window());
+ parentHWND = GetAncestor(parentHWND, GA_PARENT);
+ }
}
}
return w;