<div dir="ltr">This revision was broken. Disregard, I'm re-sending.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 8, 2017 at 10:45 AM, Matt Hoosier <span dir="ltr"><<a href="mailto:matt.hoosier@gmail.com" target="_blank">matt.hoosier@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It's useful for the shell implementation to know when these change,<br>
for example to relay the information on to taskbars or similar.<br>
<br>
To avoid ABI changes or the need to make the weston_desktop_surface<br>
definition public, new functions are introduced for attaching<br>
listeners to these signals.<br>
<br>
Signed-off-by: Matt Hoosier <<a href="mailto:matt.hoosier@gmail.com">matt.hoosier@gmail.com</a>><br>
---<br>
 libweston-desktop/libweston-<wbr>desktop.h |  6 ++++++<br>
 libweston-desktop/surface.c           | 21 +++++++++++++++++++++<br>
 2 files changed, 27 insertions(+)<br>
<br>
diff --git a/libweston-desktop/libweston-<wbr>desktop.h b/libweston-desktop/libweston-<wbr>desktop.h<br>
index 03b04c7b..e38257e5 100644<br>
--- a/libweston-desktop/libweston-<wbr>desktop.h<br>
+++ b/libweston-desktop/libweston-<wbr>desktop.h<br>
@@ -164,6 +164,12 @@ weston_desktop_surface_set_<wbr>size(struct weston_desktop_surface *surface,<br>
                                int32_t width, int32_t height);<br>
 void<br>
 weston_desktop_surface_close(<wbr>struct weston_desktop_surface *surface);<br>
+void<br>
+weston_desktop_surface_add_<wbr>title_listener(struct weston_desktop_surface *surface,<br>
+                                         struct wl_listener *listener);<br>
+void<br>
+weston_desktop_surface_add_<wbr>app_id_listener(struct weston_desktop_surface *surface,<br>
+                                          struct wl_listener *listener);<br>
<br>
 void *<br>
 weston_desktop_surface_get_<wbr>user_data(struct weston_desktop_surface *surface);<br>
diff --git a/libweston-desktop/surface.c b/libweston-desktop/surface.c<br>
index d3be9364..97a455c6 100644<br>
--- a/libweston-desktop/surface.c<br>
+++ b/libweston-desktop/surface.c<br>
@@ -64,6 +64,8 @@ struct weston_desktop_surface {<br>
                char *title;<br>
                char *app_id;<br>
                pid_t pid;<br>
+               struct wl_signal title_signal;<br>
+               struct wl_signal app_id_signal;<br>
        };<br>
        struct {<br>
                struct weston_desktop_surface *parent;<br>
@@ -287,6 +289,9 @@ weston_desktop_surface_create(<wbr>struct weston_desktop *desktop,<br>
        wl_list_init(&surface->view_<wbr>list);<br>
        wl_list_init(&surface->grab_<wbr>link);<br>
<br>
+       wl_signal_init(&surface-><wbr>title_signal);<br>
+       wl_signal_init(&surface->app_<wbr>id_signal);<br>
+<br>
        return surface;<br>
 }<br>
<br>
@@ -511,6 +516,20 @@ weston_desktop_surface_close(<wbr>struct weston_desktop_surface *surface)<br>
                                               surface->implementation_data);<br>
 }<br>
<br>
+WL_EXPORT void<br>
+weston_desktop_surface_add_<wbr>title_listener(struct weston_desktop_surface *surface,<br>
+                                         struct wl_listener *listener)<br>
+{<br>
+       wl_signal_add(&surface->title_<wbr>signal, listener);<br>
+}<br>
+<br>
+WL_EXPORT void<br>
+weston_desktop_surface_add_<wbr>app_id_listener(struct weston_desktop_surface *surface,<br>
+                                          struct wl_listener *listener)<br>
+{<br>
+       wl_signal_add(&surface->app_<wbr>id_signal, listener);<br>
+}<br>
+<br>
 struct weston_desktop_surface *<br>
 weston_desktop_surface_from_<wbr>client_link(struct wl_list *link)<br>
 {<br>
@@ -687,6 +706,7 @@ weston_desktop_surface_set_<wbr>title(struct weston_desktop_surface *surface,<br>
<br>
        free(surface->title);<br>
        surface->title = tmp;<br>
+       wl_signal_emit(&surface-><wbr>title_signal, surface->title);<br>
 }<br>
<br>
 void<br>
@@ -701,6 +721,7 @@ weston_desktop_surface_set_<wbr>app_id(struct weston_desktop_surface *surface,<br>
<br>
        free(surface->app_id);<br>
        surface->app_id = tmp;<br>
+       wl_signal_emit(&surface->app_<wbr>id_signal, surface->app_id);<br>
 }<br>
<br>
 void<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.13.3<br>
<br>
</font></span></blockquote></div><br></div>