meta-agl-core: gstreamer: Add 0001-waylandsink-Fix-xdg_shell-fullscreen-mode.patch.
[AGL/meta-agl.git] / meta-agl-core / recipes-multimedia / gstreamer / files / 0001-waylandsink-Fix-xdg_shell-fullscreen-mode.patch
1 From 58b1f41f992e457b25eda125b6f823f97128e203 Mon Sep 17 00:00:00 2001
2 From: Shinya Saito <ssaito@igel.co.jp>
3 Date: Thu, 22 Aug 2019 16:04:37 +0900
4 Subject: [PATCH] waylandsink: Fix xdg_shell fullscreen mode
5
6 xdg_shell fullscreen mode doesn't work for committing
7 xdg_surface without configure acknowledgement.
8
9 In addition, we can't set different surface setting from
10 acknowledged config in this mode.
11
12 Upstream-Status: Backport [from master/1.17.1]
13 ---
14  ext/wayland/wlwindow.c | 16 +++++++++++-----
15  1 file changed, 11 insertions(+), 5 deletions(-)
16
17 diff --git a/ext/wayland/wlwindow.c b/ext/wayland/wlwindow.c
18 index f22ebcab6..50158795b 100644
19 --- a/ext/wayland/wlwindow.c
20 +++ b/ext/wayland/wlwindow.c
21 @@ -259,7 +259,6 @@ gst_wl_window_new_toplevel (GstWlDisplay * display, const GstVideoInfo * info,
22      gboolean fullscreen, GMutex * render_lock)
23  {
24    GstWlWindow *window;
25 -  gint width;
26  
27    window = gst_wl_window_new_internal (display, render_lock);
28  
29 @@ -325,10 +324,14 @@ gst_wl_window_new_toplevel (GstWlDisplay * display, const GstVideoInfo * info,
30      goto error;
31    }
32  
33 -  /* set the initial size to be the same as the reported video size */
34 -  width =
35 -      gst_util_uint64_scale_int_round (info->width, info->par_n, info->par_d);
36 -  gst_wl_window_set_render_rectangle (window, 0, 0, width, info->height);
37 +  /* render_rectangle is already set via toplevel_configure in
38 +   * xdg_shell fullscreen mode */
39 +  if (!(display->xdg_wm_base && fullscreen)) {
40 +    /* set the initial size to be the same as the reported video size */
41 +    gint width =
42 +        gst_util_uint64_scale_int_round (info->width, info->par_n, info->par_d);
43 +    gst_wl_window_set_render_rectangle (window, 0, 0, width, info->height);
44 +  }
45  
46    return window;
47  
48 @@ -548,6 +551,9 @@ gst_wl_window_set_render_rectangle (GstWlWindow * window, gint x, gint y,
49  
50    gst_wl_window_update_borders (window);
51  
52 +  if (!window->configured)
53 +    return;
54 +
55    if (window->video_width != 0) {
56      wl_subsurface_set_sync (window->video_subsurface);
57      gst_wl_window_resize_video_surface (window, TRUE);
58 -- 
59 2.20.1
60