static void draw_server(struct tinyds_server *server);
static void draw_server_with_damage(struct tinyds_server *server);
static void draw_output(struct tinyds_output *output);
+static void view_destroy(struct tinyds_view *view);
static void draw_view(struct tinyds_view *view, pixman_image_t *dst_image);
int
draw_server_with_damage(view->server);
- wl_list_remove(&view->xdg_surface_destroy.link);
- wl_list_remove(&view->xdg_surface_map.link);
- wl_list_remove(&view->xdg_surface_unmap.link);
- wl_list_remove(&view->surface_commit.link);
- wl_list_remove(&view->link);
- free(view);
+ view_destroy(view);
}
static void
static void
fini_server(struct tinyds_server *server)
{
+ struct tinyds_view *view, *tmp;
+
+ wl_list_for_each_safe(view, tmp, &server->views, link)
+ view_destroy(view);
+
wl_list_remove(&server->new_xdg_surface.link);
}
}
static void
+view_destroy(struct tinyds_view *view)
+{
+ ds_inf("View(%p) destroyed", view);
+
+ wl_list_remove(&view->xdg_surface_destroy.link);
+ wl_list_remove(&view->xdg_surface_map.link);
+ wl_list_remove(&view->xdg_surface_unmap.link);
+ wl_list_remove(&view->surface_commit.link);
+ wl_list_remove(&view->link);
+ free(view);
+}
+
+static void
draw_view(struct tinyds_view *view, pixman_image_t *dst_image)
{
struct ds_buffer *buffer;