[mutter] wayland/surface: Get wl_output resource list via helper
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] wayland/surface: Get wl_output resource list via helper
- Date: Sun, 22 Aug 2021 17:06:11 +0000 (UTC)
commit 99531f9d4bc05c6b5cae0a6e5c7c1a99f5a24770
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Fri Feb 5 16:38:31 2021 +0100
wayland/surface: Get wl_output resource list via helper
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1712>
src/wayland/meta-wayland-outputs.c | 6 ++++++
src/wayland/meta-wayland-outputs.h | 2 ++
src/wayland/meta-wayland-surface.c | 14 ++++++--------
3 files changed, 14 insertions(+), 8 deletions(-)
---
diff --git a/src/wayland/meta-wayland-outputs.c b/src/wayland/meta-wayland-outputs.c
index 6c766ea514..623832731d 100644
--- a/src/wayland/meta-wayland-outputs.c
+++ b/src/wayland/meta-wayland-outputs.c
@@ -57,6 +57,12 @@ send_xdg_output_events (struct wl_resource *resource,
gboolean need_all_events,
gboolean *pending_done_event);
+const GList *
+meta_wayland_output_get_resources (MetaWaylandOutput *wayland_output)
+{
+ return wayland_output->resources;
+}
+
static void
output_resource_destroy (struct wl_resource *res)
{
diff --git a/src/wayland/meta-wayland-outputs.h b/src/wayland/meta-wayland-outputs.h
index 381febcdb6..f906818e7c 100644
--- a/src/wayland/meta-wayland-outputs.h
+++ b/src/wayland/meta-wayland-outputs.h
@@ -50,6 +50,8 @@ struct _MetaWaylandOutput
uint64_t winsys_id;
};
+const GList * meta_wayland_output_get_resources (MetaWaylandOutput *wayland_output);
+
void meta_wayland_outputs_init (MetaWaylandCompositor *compositor);
#endif /* META_WAYLAND_OUTPUTS_H */
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index 64e7de8db2..ee1635792e 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -1289,16 +1289,15 @@ static void
surface_entered_output (MetaWaylandSurface *surface,
MetaWaylandOutput *wayland_output)
{
- GList *iter;
- struct wl_resource *resource;
+ const GList *l;
g_signal_connect (wayland_output, "output-destroyed",
G_CALLBACK (handle_output_destroyed),
surface);
- for (iter = wayland_output->resources; iter != NULL; iter = iter->next)
+ for (l = meta_wayland_output_get_resources (wayland_output); l; l = l->next)
{
- resource = iter->data;
+ struct wl_resource *resource = l->data;
if (wl_resource_get_client (resource) !=
wl_resource_get_client (surface->resource))
@@ -1316,8 +1315,7 @@ static void
surface_left_output (MetaWaylandSurface *surface,
MetaWaylandOutput *wayland_output)
{
- GList *iter;
- struct wl_resource *resource;
+ const GList *l;
g_signal_handlers_disconnect_by_func (wayland_output,
G_CALLBACK (handle_output_destroyed),
@@ -1327,9 +1325,9 @@ surface_left_output (MetaWaylandSurface *surface,
G_CALLBACK (handle_output_bound),
surface);
- for (iter = wayland_output->resources; iter != NULL; iter = iter->next)
+ for (l = meta_wayland_output_get_resources (wayland_output); l; l = l->next)
{
- resource = iter->data;
+ struct wl_resource *resource = l->data;
if (wl_resource_get_client (resource) !=
wl_resource_get_client (surface->resource))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]