summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-05-07 18:51:42 +0200
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-05-12 08:58:56 +0000
commit55225948a97ed3c405f894c617da375e6e89e9f0 (patch)
tree8f115c245ef5715debd3e72cafb67d1592b89a99 /src
parentd33edcfe379fe4d86c8a4a0a2b02e8c6af104a71 (diff)
Create context with the correct screen in QOpenGLWindow
Targeting a non-primary screen with a QOpenGLWindow requires (at least with GLX) that the context is created with the same screen. Otherwise the context cannot be used with the window (BadMatch due to different X screens) Change-Id: I64f38ad7317d39a164bb69bb1430692319fc49d4 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qopenglwindow.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/kernel/qopenglwindow.cpp b/src/gui/kernel/qopenglwindow.cpp
index a7ba57e85e..7113345a75 100644
--- a/src/gui/kernel/qopenglwindow.cpp
+++ b/src/gui/kernel/qopenglwindow.cpp
@@ -206,6 +206,7 @@ public:
context.reset(new QOpenGLContext);
context->setShareContext(shareContext);
context->setFormat(q->requestedFormat());
+ context->setScreen(q->screen());
if (!context->create())
qWarning("QOpenGLWindow::beginPaint: Failed to create context");
if (!context->makeCurrent(q))