vlc | branch: master | Erwan Tulou <[email protected]> | 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@9: error 3: xdg_surface has never been configured

Modified-and-...
Signed-off-by: Rémi Denis-Courmont <[email protected]>

> 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;

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to