summaryrefslogtreecommitdiffstats
path: root/bsp/meta-rcar/meta-rcar-gen3-adas/recipes-graphics/wayland/weston-5.0.0/0003-add-window-set-fullscreen-at-output.patch
blob: bf3ef82c7aca085cea8517e09eba71e440f355e1 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
From 91ccb8d7fa92a55fd3d14da8f7fa883e951ae49a Mon Sep 17 00:00:00 2001
From: Valentine Barshak <valentine.barshak@cogentembedded.com>
Date: Wed, 6 Mar 2019 00:17:31 +0300
Subject: [PATCH 3/7] add window_set_fullscreen_at_output

---
 clients/toytoolkit.h |  9 +++++++++
 clients/window.c     | 38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+)

diff --git a/clients/toytoolkit.h b/clients/toytoolkit.h
index 1c0b77d..2bcecc1 100644
--- a/clients/toytoolkit.h
+++ b/clients/toytoolkit.h
@@ -74,6 +74,12 @@ display_get_compositor(struct display *display);
 struct output *
 display_get_output(struct display *display);
 
+unsigned int
+display_get_outputs_number(struct display *display);
+
+struct output *
+display_get_output_by_index(struct display *display, unsigned int index); 
+
 uint32_t
 display_get_serial(struct display *display);
 
@@ -432,6 +438,9 @@ window_is_fullscreen(struct window *window);
 void
 window_set_fullscreen(struct window *window, int fullscreen);
 
+void
+window_set_fullscreen_at_output(struct window *window, int fullscreen, struct output *output);
+
 int
 window_is_maximized(struct window *window);
 
diff --git a/clients/window.c b/clients/window.c
index b64e96c..43f20e2 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -4597,6 +4597,21 @@ window_set_fullscreen(struct window *window, int fullscreen)
 		zxdg_toplevel_v6_unset_fullscreen(window->xdg_toplevel);
 }
 
+void
+window_set_fullscreen_at_output(struct window *window, int fullscreen, struct output *output)
+{
+	if (!window->xdg_toplevel)
+		return;
+
+	if (window->fullscreen == fullscreen)
+		return;
+
+	if (fullscreen)
+		zxdg_toplevel_v6_set_fullscreen(window->xdg_toplevel, output ? output_get_wl_output(output) : NULL);
+	else
+		zxdg_toplevel_v6_unset_fullscreen(window->xdg_toplevel);
+}
+
 int
 window_is_maximized(struct window *window)
 {
@@ -6328,6 +6343,29 @@ display_get_output(struct display *display)
 	return container_of(display->output_list.next, struct output, link);
 }
 
+unsigned int
+display_get_outputs_number(struct display *display)
+{
+    return wl_list_length(&display->output_list);
+}
+
+struct output *
+display_get_output_by_index(struct display *display, unsigned int index)
+{
+    int i;
+    int n = wl_list_length(&display->output_list);
+    struct wl_list *item;
+
+    if (index >= n)
+        return NULL;
+
+    item = display->output_list.next;
+    for (i = 0; i < index; i++)
+        item = item->next;
+
+	return container_of(item, struct output, link);
+}
+
 struct wl_compositor *
 display_get_compositor(struct display *display)
 {
-- 
2.7.4