summaryrefslogtreecommitdiffstats
path: root/meta-agl-core/recipes-multimedia/gstreamer/files/0001-waylandsink-Fix-xdg_shell-fullscreen-mode.patch
blob: 9a11fa1d7ca7070ea79ba09dbc5917b794d1ee5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
From 58b1f41f992e457b25eda125b6f823f97128e203 Mon Sep 17 00:00:00 2001
From: Shinya Saito <ssaito@igel.co.jp>
Date: Thu, 22 Aug 2019 16:04:37 +0900
Subject: [PATCH] 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.

Upstream-Status: Backport [from master/1.17.1]
---
 ext/wayland/wlwindow.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/ext/wayland/wlwindow.c b/ext/wayland/wlwindow.c
index f22ebcab6..50158795b 100644
--- a/ext/wayland/wlwindow.c
+++ b/ext/wayland/wlwindow.c
@@ -259,7 +259,6 @@ gst_wl_window_new_toplevel (GstWlDisplay * display, const GstVideoInfo * info,
     gboolean fullscreen, GMutex * render_lock)
 {
   GstWlWindow *window;
-  gint width;
 
   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;
   }
 
-  /* set the initial size to be the same as the reported video size */
-  width =
-      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);
+  /* 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 */
+    gint width =
+        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);
+  }
 
   return window;
 
@@ -548,6 +551,9 @@ gst_wl_window_set_render_rectangle (GstWlWindow * window, gint x, gint y,
 
   gst_wl_window_update_borders (window);
 
+  if (!window->configured)
+    return;
+
   if (window->video_width != 0) {
     wl_subsurface_set_sync (window->video_subsurface);
     gst_wl_window_resize_video_surface (window, TRUE);
-- 
2.20.1