summaryrefslogtreecommitdiffstats
path: root/meta-agl-core/recipes-graphics/wayland/weston/0001-libweston-Send-name-description-update-wl_output-to-.patch
blob: 46e305d1218512dc797abb8a1876b79eddb957bb (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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
From 5361d157ff6b11d5cb7a9f989abe5f376c9e2efa Mon Sep 17 00:00:00 2001
From: Marius Vlad <marius.vlad@collabora.com>
Date: Wed, 24 Aug 2022 11:43:06 +0300
Subject: [PATCH] libweston: Send name,description, update wl_output to ver 4

These have been in wayland a while back with version 1.20.0.

We also need to update the test client helper with this bump, as
those bind to version 4.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
---
 libweston/compositor.c            | 14 +++++++++++++-
 tests/weston-test-client-helper.c | 18 ++++++++++++++++++
 tests/weston-test-client-helper.h |  2 ++
 3 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/libweston/compositor.c b/libweston/compositor.c
index 1670c50..af7c71e 100644
--- a/libweston/compositor.c
+++ b/libweston/compositor.c
@@ -184,6 +184,12 @@ weston_mode_switch_send_events(struct weston_head *head,
 		if (version >= WL_OUTPUT_SCALE_SINCE_VERSION && scale_changed)
 			wl_output_send_scale(resource, output->current_scale);
 
+		if (version >= WL_OUTPUT_NAME_SINCE_VERSION)
+			wl_output_send_name(resource, head->name);
+
+		if (version >= WL_OUTPUT_DESCRIPTION_SINCE_VERSION)
+			wl_output_send_description(resource, head->model);
+
 		if (version >= WL_OUTPUT_DONE_SINCE_VERSION)
 			wl_output_send_done(resource);
 	}
@@ -5198,6 +5204,12 @@ bind_output(struct wl_client *client,
 				    mode->refresh);
 	}
 
+	if (version >= WL_OUTPUT_NAME_SINCE_VERSION)
+		wl_output_send_name(resource, head->name);
+
+	if (version >= WL_OUTPUT_DESCRIPTION_SINCE_VERSION)
+		wl_output_send_description(resource, head->model);
+
 	if (version >= WL_OUTPUT_DONE_SINCE_VERSION)
 		wl_output_send_done(resource);
 }
@@ -5206,7 +5218,7 @@ static void
 weston_head_add_global(struct weston_head *head)
 {
 	head->global = wl_global_create(head->compositor->wl_display,
-					&wl_output_interface, 3,
+					&wl_output_interface, 4,
 					head, bind_output);
 }
 
diff --git a/tests/weston-test-client-helper.c b/tests/weston-test-client-helper.c
index 01c4b80..8369c40 100644
--- a/tests/weston-test-client-helper.c
+++ b/tests/weston-test-client-helper.c
@@ -715,6 +715,20 @@ output_handle_scale(void *data,
 	output->scale = scale;
 }
 
+static void
+output_handle_name(void *data, struct wl_output *wl_output, const char *name)
+{
+	struct output *output = data;
+	output->name = strdup(name);
+}
+
+static void
+output_handle_description(void *data, struct wl_output *wl_output, const char *desc)
+{
+	struct output *output = data;
+	output->name = strdup(desc);
+}
+
 static void
 output_handle_done(void *data,
 		   struct wl_output *wl_output)
@@ -729,6 +743,8 @@ static const struct wl_output_listener output_listener = {
 	output_handle_mode,
 	output_handle_done,
 	output_handle_scale,
+	output_handle_name,
+	output_handle_description,
 };
 
 static void
@@ -737,6 +753,8 @@ output_destroy(struct output *output)
 	assert(wl_proxy_get_version((struct wl_proxy *)output->wl_output) >= 3);
 	wl_output_release(output->wl_output);
 	wl_list_remove(&output->link);
+	free(output->name);
+	free(output->desc);
 	free(output);
 }
 
diff --git a/tests/weston-test-client-helper.h b/tests/weston-test-client-helper.h
index 8e1505d..9e05009 100644
--- a/tests/weston-test-client-helper.h
+++ b/tests/weston-test-client-helper.h
@@ -163,6 +163,8 @@ struct output {
 	int height;
 	int scale;
 	int initialized;
+	char *name;
+	char *desc;
 };
 
 struct buffer {
-- 
2.35.1