From eb375bf9583eed0a1a588ee9d436a2219e2809f8 Mon Sep 17 00:00:00 2001 From: Erwan Tulou Date: Sun, 10 Dec 2017 19:00:15 +0100 Subject: [PATCH] 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 --- 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(); -- 2.11.4.GIT