From 55225948a97ed3c405f894c617da375e6e89e9f0 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 7 May 2015 18:51:42 +0200 Subject: 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 --- src/gui/kernel/qopenglwindow.cpp | 1 + 1 file changed, 1 insertion(+) 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)) -- cgit v1.2.3