<div dir="ltr">Okay, this one should be ready to review. Sorry for the noise on the first attempt.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 8, 2017 at 10:56 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"><span class="">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>
</span> libweston-desktop/libweston-<wbr>desktop.h |  3 +++<br>
 libweston-desktop/surface.c           | 12 ++++++++++++<br>
 2 files changed, 15 insertions(+)<br>
<br>
diff --git a/libweston-desktop/libweston-<wbr>desktop.h b/libweston-desktop/libweston-<wbr>desktop.h<br>
index 03b04c7b..c43568ac 100644<br>
--- a/libweston-desktop/libweston-<wbr>desktop.h<br>
+++ b/libweston-desktop/libweston-<wbr>desktop.h<br>
@@ -164,6 +164,9 @@ weston_desktop_surface_set_<wbr>size(struct weston_desktop_surface *surface,<br>
<span class="">                                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>
<br>
</span><span class=""> 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>
</span>index d3be9364..d00ba5d6 100644<br>
--- a/libweston-desktop/surface.c<br>
+++ b/libweston-desktop/surface.c<br>
@@ -64,6 +64,7 @@ struct weston_desktop_surface {<br>
<span class="">                char *title;<br>
                char *app_id;<br>
                pid_t pid;<br>
+               struct wl_signal title_signal;<br>
</span>        };<br>
        struct {<br>
                struct weston_desktop_surface *parent;<br>
@@ -287,6 +288,8 @@ weston_desktop_surface_create(<wbr>struct weston_desktop *desktop,<br>
<span class="">        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>
+<br>
</span>        return surface;<br>
 }<br>
<br>
@@ -511,6 +514,13 @@ weston_desktop_surface_close(<wbr>struct weston_desktop_surface *surface)<br>
<span class="">                                               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>
</span><span class=""> struct weston_desktop_surface *<br>
 weston_desktop_surface_from_<wbr>client_link(struct wl_list *link)<br>
 {<br>
</span>@@ -687,6 +697,7 @@ weston_desktop_surface_set_<wbr>title(struct weston_desktop_surface *surface,<br>
<span class=""><br>
        free(surface->title);<br>
        surface->title = tmp;<br>
</span>+       wl_signal_emit(&surface-><wbr>title_signal, surface);<br>
 }<br>
<br>
 void<br>
@@ -701,6 +712,7 @@ weston_desktop_surface_set_<wbr>app_id(struct weston_desktop_surface *surface,<br>
<span class=""><br>
        free(surface->app_id);<br>
        surface->app_id = tmp;<br>
</span>+       wl_signal_emit(&surface-><wbr>title_signal, surface);<br>
 }<br>
<br>
 void<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.13.3<br>
<br>
</font></span></blockquote></div><br></div>