aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2019-10-09 11:09:51 +0200
committerAndy Shaw <andy.shaw@qt.io>2019-11-28 12:06:05 +0000
commit33d93478aa2a53983dd6a02588db2dc0ccbe694d (patch)
tree13547dc334b48684c65aea339932fd27d05732a2
parent5dad0afa9e0905bd384878327f19cc7faf3d8d9f (diff)
Set the screen on the QOpenGLContext to be the same as the window
This ensures that the QOpenGLContext has the right screen information and can create a compatible context for use with QQuickWidget. Change-Id: I9d78ff2b616e5c1d1c11d1da438ce336a0f24953 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit 4080025fed9d43a78b578bcab67397712459d28c)
-rw-r--r--src/quickwidgets/qquickwidget.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp
index b63f7de9f1..55c095af8e 100644
--- a/src/quickwidgets/qquickwidget.cpp
+++ b/src/quickwidgets/qquickwidget.cpp
@@ -878,7 +878,9 @@ void QQuickWidgetPrivate::createContext()
context = new QOpenGLContext;
context->setFormat(offscreenWindow->requestedFormat());
-
+ const QWindow *win = q->window()->windowHandle();
+ if (win && win->screen())
+ context->setScreen(win->screen());
QOpenGLContext *shareContext = qt_gl_global_share_context();
if (!shareContext)
shareContext = QWidgetPrivate::get(q->window())->shareContext();