[vlc-commits] xdg-shell: provide a fully configured window

Erwan Tulou git at videolan.org
Tue Jun 19 21:09:27 CEST 2018


vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Tue Jun 19 21:42:37 2018 +0300| [6ef463a42a0273a5653543c557259d5d1fd8831e] | committer: Rémi Denis-Courmont

xdg-shell: provide a fully configured window

On Weston, this fixes the following test case:
cmd: vlc -I qt -V wl --no-embedded-video --no-video-deco
error: xdg_surface at 9: error 3: xdg_surface has never been configured

Modified-and-...
Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

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

 modules/video_output/wayland/xdg-shell.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/modules/video_output/wayland/xdg-shell.c b/modules/video_output/wayland/xdg-shell.c
index 4d639f05ad..9698b5e281 100644
--- a/modules/video_output/wayland/xdg-shell.c
+++ b/modules/video_output/wayland/xdg-shell.c
@@ -96,6 +96,7 @@ struct vout_window_sys_t
             unsigned height;
             bool fullscreen;
         } latch;
+        bool configured;
     } wm;
 # ifdef XDG_SHELL_UNSTABLE
     bool unstable;
@@ -302,6 +303,7 @@ static void xdg_surface_configure_cb(void *data, struct xdg_surface *surface,
         vout_window_ReportWindowed(wnd);
 
     xdg_surface_ack_configure(surface, serial);
+    sys->wm.configured = true;
 }
 
 static const struct xdg_surface_listener xdg_surface_cbs =
@@ -480,6 +482,7 @@ static int Open(vout_window_t *wnd, const vout_window_cfg_t *cfg)
     sys->wm.latch.width = 0;
     sys->wm.latch.height = 0;
     sys->wm.latch.fullscreen = false;
+    sys->wm.configured = false;
     sys->set.width = cfg->width;
     sys->set.height = cfg->height;
     wl_list_init(&sys->outputs);
@@ -581,8 +584,14 @@ static int Open(vout_window_t *wnd, const vout_window_cfg_t *cfg)
         goto error;
     }
 
+    wl_surface_commit(surface);
     wl_display_flush(display);
 
+#ifdef XDG_SHELL
+    while (!sys->wm.configured)
+        wl_display_dispatch(display);
+#endif
+
     wnd->type = VOUT_WINDOW_TYPE_WAYLAND;
     wnd->handle.wl = surface;
     wnd->display.wl = display;



More information about the vlc-commits mailing list