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

Erwan Tulou git at videolan.org
Sun Dec 17 23:18:16 CET 2017


vlc/vlc-3.0 | branch: master | Erwan Tulou <erwan10 at videolan.org> | Sun Dec 10 19:00:15 2017 +0100| [844119079d1e2266f8a041d7b0caf1ac1f248f89] | 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>
(cherry picked from commit eb375bf9583eed0a1a588ee9d436a2219e2809f8)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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