aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickrendercontrol.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-02-19 13:31:51 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-21 14:21:49 +0100
commit08c4a88a77563e50860c34164414fe014271ccc2 (patch)
treed63420d27a16a5464e06a60d5d7c6ab2d258cc2e /src/quick/items/qquickrendercontrol.cpp
parentfd5c629f4336b1f79afc653fceaf0f930e71eccd (diff)
Avoid extra platformwindows with QQuickWidget
QQuickWidget is nice but does not work on platforms like eglfs because it always creates a (hidden) platform window for the QQuickWindow. This is now fixed by avoiding calling create() on the window and using the toplevel window of the QQuickWidget instead. Change-Id: Ia552f7a16d8b913fb798fde04b9304c6d037a46c Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'src/quick/items/qquickrendercontrol.cpp')
-rw-r--r--src/quick/items/qquickrendercontrol.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/quick/items/qquickrendercontrol.cpp b/src/quick/items/qquickrendercontrol.cpp
index 7e4335ba63..faee1358ae 100644
--- a/src/quick/items/qquickrendercontrol.cpp
+++ b/src/quick/items/qquickrendercontrol.cpp
@@ -114,9 +114,13 @@ void QQuickRenderControl::initialize(QOpenGLContext *gl)
Q_D(QQuickRenderControl);
if (!d->window)
return;
- bool current = gl->makeCurrent(d->window);
- if (current)
- QQuickWindowPrivate::get(d->window)->context->initialize(gl);
+
+ // It is the caller's responsiblity to make a context/surface current.
+ // It cannot be done here since the surface to use may not be the
+ // surface belonging to window. In fact window may not have a native
+ // window/surface at all.
+
+ QQuickWindowPrivate::get(d->window)->context->initialize(gl);
}
void QQuickRenderControl::invalidate()