waylandsink: Fix xdg_shell fullscreen mode

xdg_shell fullscreen mode doesn't work for committing
xdg_surface without configure acknowledgement.

In addition, we can't set different surface setting from
acknowledged config in this mode.
This commit is contained in:
Shinya Saito 2019-08-22 16:04:37 +09:00 committed by Nicolas Dufresne
parent bebf20c906
commit 58b1f41f99

View File

@ -259,7 +259,6 @@ gst_wl_window_new_toplevel (GstWlDisplay * display, const GstVideoInfo * info,
gboolean fullscreen, GMutex * render_lock) gboolean fullscreen, GMutex * render_lock)
{ {
GstWlWindow *window; GstWlWindow *window;
gint width;
window = gst_wl_window_new_internal (display, render_lock); window = gst_wl_window_new_internal (display, render_lock);
@ -325,10 +324,14 @@ gst_wl_window_new_toplevel (GstWlDisplay * display, const GstVideoInfo * info,
goto error; goto error;
} }
/* render_rectangle is already set via toplevel_configure in
* xdg_shell fullscreen mode */
if (!(display->xdg_wm_base && fullscreen)) {
/* set the initial size to be the same as the reported video size */ /* set the initial size to be the same as the reported video size */
width = gint width =
gst_util_uint64_scale_int_round (info->width, info->par_n, info->par_d); gst_util_uint64_scale_int_round (info->width, info->par_n, info->par_d);
gst_wl_window_set_render_rectangle (window, 0, 0, width, info->height); gst_wl_window_set_render_rectangle (window, 0, 0, width, info->height);
}
return window; return window;
@ -548,6 +551,9 @@ gst_wl_window_set_render_rectangle (GstWlWindow * window, gint x, gint y,
gst_wl_window_update_borders (window); gst_wl_window_update_borders (window);
if (!window->configured)
return;
if (window->video_width != 0) { if (window->video_width != 0) {
wl_subsurface_set_sync (window->video_subsurface); wl_subsurface_set_sync (window->video_subsurface);
gst_wl_window_resize_video_surface (window, TRUE); gst_wl_window_resize_video_surface (window, TRUE);