Add native handle for context in offscreen plugin

Offscreen plugin can be compiled with x11 support.
In case of glx add missing native handle for context.

This fixes crashes of running web engine with offscreenplugin
(with glx support).

Task-number: QTBUG-63346
Change-Id: Ia717ad2551536fbfdfb6633e506704a3ebe42a2b
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
bb10
Michal Klocek 2018-11-19 15:49:48 +01:00
parent 56a8c27754
commit 48f5b671a3
1 changed files with 4 additions and 0 deletions

View File

@ -41,6 +41,7 @@
#include <QByteArray>
#include <QOpenGLContext>
#include <QtPlatformHeaders/QGLXNativeContext>
#include <X11/Xlib.h>
#include <GL/glx.h>
@ -228,6 +229,9 @@ QOffscreenX11GLXContext::QOffscreenX11GLXContext(QOffscreenX11Info *x11, QOpenGL
d->window = createDummyWindow(x11, visualInfo);
XFree(visualInfo);
}
if (d->context)
context->setNativeHandle(QVariant::fromValue<QGLXNativeContext>(QGLXNativeContext(d->context)));
}
QOffscreenX11GLXContext::~QOffscreenX11GLXContext()