[vlc-commits] qt(wayland): fix video widget failing to display video.

Erwan Tulou git at videolan.org
Thu Dec 14 00:58:00 CET 2017


vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Sun Dec 10 19:00:15 2017 +0100| [eb375bf9583eed0a1a588ee9d436a2219e2809f8] | committer: Jean-Baptiste Kempf

qt(wayland): fix video widget failing to display video.

Setting Qt:WA_DontCreateNativeAncestors in addition to Qt::WA_NativeWindow
tells qt to create a native window for the widget and only for the widget.

For Wayland, this resulted in one single wayland subsurface instead of a
tree of nested subsurfaces. Wayland is a bit convoluted when it comes to
mapping/unmapping nested subsurfaces, which accounted for the video failing
to be displayed.

For X11, on the contrary, setting Qt:WA_DontCreateNativeAncestors proved
wrong with some misplacement in the video. So, this parameter is set
*** ONLY *** in a Wayland context.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=eb375bf9583eed0a1a588ee9d436a2219e2809f8
---

 modules/gui/qt/components/interface_widgets.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/gui/qt/components/interface_widgets.cpp b/modules/gui/qt/components/interface_widgets.cpp
index a5fef977d3..98dfdebfbe 100644
--- a/modules/gui/qt/components/interface_widgets.cpp
+++ b/modules/gui/qt/components/interface_widgets.cpp
@@ -164,6 +164,9 @@ bool VideoWidget::request( struct vout_window_t *p_wnd )
 #ifdef QT5_HAS_WAYLAND
         case VOUT_WINDOW_TYPE_WAYLAND:
         {
+            /* Ensure only the video widget is native (needed for Wayland) */
+            stable->setAttribute( Qt::WA_DontCreateNativeAncestors, true);
+
             QWindow *window = stable->windowHandle();
             assert(window != NULL);
             window->create();



More information about the vlc-commits mailing list