[vlc-devel] patches to fix Wayland issues

erwan.tulou at gmail.com erwan.tulou at gmail.com
Fri May 25 14:22:13 CEST 2018


    Please find attached two patches that solve key issues regarding 
display of any video on Wayland within the qt interface with the default 
Opengl vout.

- patch1:  vlc_gl_Resize() was fixed lately, but it is still misused in 
the gl vout display module. This one-line change makes it fully 
functional for qt (embedded video).

- patch2: remove a highly dubious call within qt, that leads vlc to 
crash on Wayland (at least with Gnome Mutter)

These patches should not pose any problems, but may interfere with some 
other work on Wayland. So, any objection to commit them ?


L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
-------------- next part --------------
From 7f42d958e39b0fb78eb0685006cbb582afd985ea Mon Sep 17 00:00:00 2001
From: Erwan Tulou <erwan10 at videolan.org>
Date: Mon, 21 May 2018 23:14:54 +0200
Subject: [PATCH 1/2] egl(Wayland): fix wrong use of vlc_gl_Resize

vlc_gl_Resize is meant to report the change in size of the display to
the underlying egl library, not the inner video size within the display.

this fix makes embedded video within qt fully functional on Wayland with
the default -V gl option.
 modules/video_output/opengl/display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/video_output/opengl/display.c b/modules/video_output/opengl/display.c
index c391a6fc48..1c22540c36 100644
--- a/modules/video_output/opengl/display.c
+++ b/modules/video_output/opengl/display.c
@@ -246,7 +246,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
             c.align.vertical = VOUT_DISPLAY_ALIGN_TOP;
         vout_display_PlacePicture (&place, src, &c, false);
-        vlc_gl_Resize (sys->gl, place.width, place.height);
+        vlc_gl_Resize (sys->gl, c.display.width, c.display.height);
         if (vlc_gl_MakeCurrent (sys->gl) != VLC_SUCCESS)
             return VLC_EGENERIC;
         vout_display_opengl_SetWindowAspectRatio(sys->vgl, (float)place.width / place.height);

-------------- next part --------------
From fbc83e99e11bc3118e74d9d14103881d9c8b12aa Mon Sep 17 00:00:00 2001
From: Erwan Tulou <erwan10 at videolan.org>
Date: Fri, 25 May 2018 12:37:21 +0200
Subject: [PATCH 2/2] qt: remove dubious and non functional call

As no videoWidget is ever inserted into the stackWidgetsSizes QMap, a
default QSize is provided with width and height = -1. These uninitialized
values are then propagated and end up as a no op at some point.

Yet, on Wayland, this -1 default values can end up being transmitted to
the Wayland server, that treats them as invalid values (protocol error).
At least the Gnome server(mutter) does.

This fix simply removes the call.
 modules/gui/qt/main_interface.cpp | 2 --
 1 file changed, 2 deletions(-)

diff --git a/modules/gui/qt/main_interface.cpp b/modules/gui/qt/main_interface.cpp
index 6d141dac91..7c24c53c8d 100644
--- a/modules/gui/qt/main_interface.cpp
+++ b/modules/gui/qt/main_interface.cpp
@@ -678,8 +678,6 @@ inline void MainInterface::showTab( QWidget *widget, bool video_closing )
     stackCentralW->setCurrentWidget( widget );
-    if( b_autoresize )
-        resizeStack( stackWidgetsSizes[widget].width(), stackWidgetsSizes[widget].height() );
 #ifdef DEBUG_INTF
     msg_Dbg( p_intf, "Stack state changed to %s, index %i",

More information about the vlc-devel mailing list