QNX: Use window group of top-level window for mmr
authorFrank Osterfeld <frank.osterfeld.qnx@kdab.com>
Thu, 28 Nov 2013 16:06:17 +0000 (17:06 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 19 Feb 2014 15:26:35 +0000 (16:26 +0100)
Pass the top-level window's window group to mm-renderer,
as required by mmr.

Change-Id: I2a2e8b4aa48f5c2292b03593c6d528068f383b5c
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
src/plugins/qnx/mediaplayer/mmrenderervideowindowcontrol.cpp

index c35c6d1..ef74cba 100644 (file)
@@ -207,10 +207,18 @@ void MmRendererVideoWindowControl::attachDisplay(mmr_context_t *context)
         return;
     }
 
+    QWindow *windowForGroup = window;
+
+    //According to mmr_output_attach() documentation, the window group name of the
+    //application's top-level window is expected.
+    while (windowForGroup->parent())
+        windowForGroup = windowForGroup->parent();
+
     const char * const groupNameData = static_cast<const char *>(
-        nativeInterface->nativeResourceForWindow("windowGroup", window));
+        nativeInterface->nativeResourceForWindow("windowGroup", windowForGroup));
     if (!groupNameData) {
-        qDebug() << "MmRendererVideoWindowControl: Unable to find window group for window" << window;
+        qDebug() << "MmRendererVideoWindowControl: Unable to find window group for window"
+                 << windowForGroup;
         return;
     }