From 21ca4ac9d3b29f5c08fa9db8cfbcf08981cfa9f6 Mon Sep 17 00:00:00 2001 From: Roman Nowicki Date: Thu, 19 Nov 2015 11:55:19 +0100 Subject: [PATCH] qml: proper initialization if scene is already initialized The scene graph can be initialized when the we receive window handle change notification and so we will not receive a scenegraph initialization notification. Initialize ourself in this case. https://bugzilla.gnome.org/show_bug.cgi?id=758337 --- ext/qt/qtitem.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/qt/qtitem.cc b/ext/qt/qtitem.cc index 69d0324..ec2e859 100644 --- a/ext/qt/qtitem.cc +++ b/ext/qt/qtitem.cc @@ -412,7 +412,11 @@ void QtGLVideoItem::handleWindowChanged(QQuickWindow *win) { if (win) { - connect(win, SIGNAL(sceneGraphInitialized()), this, SLOT(onSceneGraphInitialized()), Qt::DirectConnection); + if (win->isSceneGraphInitialized()) + onSceneGraphInitialized(); + else + connect(win, SIGNAL(sceneGraphInitialized()), this, SLOT(onSceneGraphInitialized()), Qt::DirectConnection); + connect(win, SIGNAL(sceneGraphInvalidated()), this, SLOT(onSceneGraphInvalidated()), Qt::DirectConnection); } else { this->priv->qt_context = NULL; -- 2.7.4