summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>2016-03-07 16:19:37 +0200
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2016-03-24 13:48:21 +0200
commit13281f693ceec83c514000029c6ae1f2439baa10 (patch)
tree2ea6eaf9fde1bb8e1c32a7b49b1e00ad2e7523ae
parent1c04d7b897227be4c5e78d0bc67f4b4e8afb0453 (diff)
ivi-shell: add shell surface labels
To be used by the Weston timeline feature for identifying surfaces in a trace. The 'get_label' functionality can also be used by any debugging code, too. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Eugen Friedrich <friedrix@gmail.com>
-rw-r--r--ivi-shell/ivi-shell.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c
index 2ff37847..9c11f6fc 100644
--- a/ivi-shell/ivi-shell.c
+++ b/ivi-shell/ivi-shell.c
@@ -121,6 +121,19 @@ ivi_shell_surface_configure(struct weston_surface *surface,
}
}
+static int
+ivi_shell_surface_get_label(struct weston_surface *surface,
+ char *buf,
+ size_t len)
+{
+ struct ivi_shell_surface *shell_surf = get_ivi_shell_surface(surface);
+
+ if (!shell_surf)
+ return snprintf(buf, len, "unidentified window in ivi-shell");
+
+ return snprintf(buf, len, "ivi-surface %#x", shell_surf->id_surface);
+}
+
static void
layout_surface_cleanup(struct ivi_shell_surface *ivisurf)
{
@@ -131,6 +144,7 @@ layout_surface_cleanup(struct ivi_shell_surface *ivisurf)
ivisurf->surface->configure = NULL;
ivisurf->surface->configure_private = NULL;
+ weston_surface_set_label_func(ivisurf->surface, NULL);
ivisurf->surface = NULL;
// destroy weston_surface destroy signal.
@@ -262,6 +276,8 @@ application_surface_create(struct wl_client *client,
weston_surface->configure = ivi_shell_surface_configure;
weston_surface->configure_private = ivisurf;
+ weston_surface_set_label_func(weston_surface,
+ ivi_shell_surface_get_label);
res = wl_resource_create(client, &ivi_surface_interface, 1, id);
if (res == NULL) {