<br><br><div class="gmail_quote">On Thu, Oct 4, 2012 at 5:07 PM, Scott Moreau <span dir="ltr"><<a href="mailto:oreaus@gmail.com" target="_blank">oreaus@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This patch uses the special surface_data interface to send surface_data to the<br>
shell. The shell then uses this information to render a window list in the panel.<br>
<br>
---<br>
<br>
v6:<br>
<br>
* Rebased on latest master<br>
* Clean up window list when desktop-shell exits<br>
* Renamed some functions to better fit their arguments<br></blockquote><div><br><snip><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
+static void<br>
+panel_list_item_remove(struct list_item *item)<br>
+{<br>
+       item->panel->surface_count--;<br>
+       wl_list_remove(&item->link);<br>
+       wl_list_remove(&item->surface_link);<br>
+       widget_destroy(item->widget);<br>
+       panel_window_list_schedule_redraw(item->panel);<br>
+       free(item);<br>
+}<br></blockquote><div><br><snip><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+<br>
+static void<br>
+desktop_destroy_surface(struct surface *surface)<br>
+{<br>
+       struct list_item *item, *next;<br>
+<br>
+       wl_list_for_each_safe(item, next, &surface->item_list, surface_link)<br>
+               panel_list_item_remove(item);<br>
+<br>
+       wl_list_remove(&surface->link);<br>
+       free(surface->title);<br>
+       free(surface);<br>
+}<br>
+<br></blockquote><div><br><snip><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 static void<br>
+desktop_destroy_surfaces(struct desktop *desktop)<br>
+{<br>
+       struct surface *surface, *next;<br>
+<br>
+       wl_list_for_each_safe(surface, next, &desktop->surfaces, link)<br>
+               desktop_destroy_surface(surface);<br>
+}<br>
+<br></blockquote><div><br><snip><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
@@ -1126,6 +1610,7 @@ int main(int argc, char *argv[])<br>
        /* Cleanup */<br>
        grab_surface_destroy(&desktop);<br>
        desktop_destroy_outputs(&desktop);<br>
+       desktop_destroy_surfaces(&desktop);<br>
        if (desktop.unlock_dialog)<br>
                unlock_dialog_destroy(desktop.unlock_dialog);<br>
        desktop_shell_destroy(desktop.shell);<br><br></blockquote><div> </div><div><snip><br> <br></div></div>I noticed that this cleanup sequence fails, blocking on widget_destroy(). It seems we need a way to know if toytoolkits display->running is true, from the client. I created an int display_is_running(struct display *display) {return display->running;}, and then check this is true before calling widget_destroy() and panel_window_list_schedule_redraw() in panel_list_item_remove(). Is there a better way or is this a good solution? Should all toytoolkit functions check for display->running? Seems like that might look messy.<br>
<br><br>Thanks,<br><br>Scott<br>