<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2016-03-22 15:48 GMT+01:00 Pekka Paalanen <span dir="ltr"><<a href="mailto:ppaalanen@gmail.com" target="_blank">ppaalanen@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">From: Pekka Paalanen <<a href="mailto:pekka.paalanen@collabora.co.uk">pekka.paalanen@collabora.co.uk</a>><br>
<br>
To be used by the Weston timeline feature for identifying surfaces in a<br>
trace. The 'get_label' functionality can also be used by any debugging<br>
code, too.<br>
<br>
Signed-off-by: Pekka Paalanen <<a href="mailto:pekka.paalanen@collabora.co.uk">pekka.paalanen@collabora.co.uk</a>><br>
---<br>
ivi-shell/ivi-shell.c | 16 ++++++++++++++++<br>
1 file changed, 16 insertions(+)<br>
<br>
diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c<br>
index 2ff3784..9c11f6f 100644<br>
--- a/ivi-shell/ivi-shell.c<br>
+++ b/ivi-shell/ivi-shell.c<br>
@@ -121,6 +121,19 @@ ivi_shell_surface_configure(struct weston_surface *surface,<br>
}<br>
}<br>
<br>
+static int<br>
+ivi_shell_surface_get_label(struct weston_surface *surface,<br>
+ char *buf,<br>
+ size_t len)<br>
+{<br>
+ struct ivi_shell_surface *shell_surf = get_ivi_shell_surface(surface);<br>
+<br>
+ if (!shell_surf)<br>
+ return snprintf(buf, len, "unidentified window in ivi-shell");<br>
+<br>
+ return snprintf(buf, len, "ivi-surface %#x", shell_surf->id_surface);<br>
+}<br>
+<br>
static void<br>
layout_surface_cleanup(struct ivi_shell_surface *ivisurf)<br>
{<br>
@@ -131,6 +144,7 @@ layout_surface_cleanup(struct ivi_shell_surface *ivisurf)<br>
<br>
ivisurf->surface->configure = NULL;<br>
ivisurf->surface->configure_private = NULL;<br>
+ weston_surface_set_label_func(ivisurf->surface, NULL);<br>
ivisurf->surface = NULL;<br>
<br>
// destroy weston_surface destroy signal.<br>
@@ -262,6 +276,8 @@ application_surface_create(struct wl_client *client,<br>
<br>
weston_surface->configure = ivi_shell_surface_configure;<br>
weston_surface->configure_private = ivisurf;<br>
+ weston_surface_set_label_func(weston_surface,<br>
+ ivi_shell_surface_get_label);<br>
<br>
res = wl_resource_create(client, &ivi_surface_interface, 1, id);<br>
if (res == NULL) {<br>
<span class=""><font color="#888888">--<br>
2.7.3<br>
<br>
_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/wayland-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</font></span></blockquote></div><br>Looks good<br>
<span class="">Reviewed</span>-<span class="">by</span>: Eugen Friedrich <<a href="mailto:friedrix@gmail.com">friedrix@gmail.com</a>><br></div></div>