void kde_server_decoration_update_default(void);
void kde_server_decoration_set_view(struct view *view, struct wlr_surface *surface);
+void kde_server_decoration_finish(struct server *server);
+void xdg_server_decoration_finish(struct server *server);
+
#endif /* LABWC_DECORATIONS_H */
void xdg_popup_create(struct view *view, struct wlr_xdg_popup *wlr_popup);
void xdg_shell_init(struct server *server);
+void xdg_shell_finish(struct server *server);
/*
* desktop.c routines deal with a collection of views
enum view_edge edge_from_cursor(struct seat *seat, struct output **dest_output);
void output_init(struct server *server);
+void output_finish(struct server *server);
void output_manager_init(struct server *server);
struct output *output_from_wlr_output(struct server *server,
struct wlr_output *wlr_output);
};
void layers_init(struct server *server);
+void layers_finish(struct server *server);
void layers_arrange(struct output *output);
void layer_try_set_focus(struct seat *seat,
server->kde_server_decoration.notify = handle_new_server_decoration;
}
+void
+kde_server_decoration_finish(struct server *server)
+{
+ wl_list_remove(&server->kde_server_decoration.link);
+}
&server->xdg_toplevel_decoration);
server->xdg_toplevel_decoration.notify = xdg_toplevel_decoration;
}
+
+void
+xdg_server_decoration_finish(struct server *server)
+{
+ wl_list_remove(&server->xdg_toplevel_decoration.link);
+}
struct {
struct wlr_idle_inhibit_manager_v1 *manager;
struct wl_listener on_new_inhibitor;
+ struct wl_listener on_destroy;
} inhibitor;
struct wlr_seat *wlr_seat;
- struct wl_listener on_display_destroy;
};
static struct lab_idle_manager *manager;
}
static void
-handle_display_destroy(struct wl_listener *listener, void *data)
+handle_inhibitor_manager_destroy(struct wl_listener *listener, void *data)
{
- /*
- * All the managers will react to the display
- * destroy signal as well and thus clean up.
- */
- wl_list_remove(&manager->on_display_destroy.link);
+ wl_list_remove(&manager->inhibitor.on_new_inhibitor.link);
+ wl_list_remove(&manager->inhibitor.on_destroy.link);
zfree(manager);
}
wl_signal_add(&manager->inhibitor.manager->events.new_inhibitor,
&manager->inhibitor.on_new_inhibitor);
- manager->on_display_destroy.notify = handle_display_destroy;
- wl_display_add_destroy_listener(display, &manager->on_display_destroy);
+ manager->inhibitor.on_destroy.notify = handle_inhibitor_manager_destroy;
+ wl_signal_add(&manager->inhibitor.manager->events.destroy,
+ &manager->inhibitor.on_destroy);
}
void
wl_list_remove(&seat->request_cursor.link);
wl_list_remove(&seat->request_set_shape.link);
wl_list_remove(&seat->request_set_selection.link);
+ wl_list_remove(&seat->request_set_primary_selection.link);
wlr_xcursor_manager_destroy(seat->xcursor_manager);
wlr_cursor_destroy(seat->cursor);
wl_signal_add(&server->layer_shell->events.new_surface,
&server->new_layer_surface);
}
+
+void
+layers_finish(struct server *server)
+{
+ wl_list_remove(&server->new_layer_surface.link);
+}
output_manager_init(server);
}
+static void output_manager_finish(struct server *server);
+
+void
+output_finish(struct server *server)
+{
+ wl_list_remove(&server->new_output.link);
+ output_manager_finish(server);
+}
+
static void
output_update_for_layout_change(struct server *server)
{
&server->gamma_control_set_gamma);
}
+static void
+output_manager_finish(struct server *server)
+{
+ wl_list_remove(&server->output_layout_change.link);
+ wl_list_remove(&server->output_manager_apply.link);
+ wl_list_remove(&server->output_manager_test.link);
+ wl_list_remove(&server->gamma_control_set_gamma.link);
+}
+
struct output *
output_from_wlr_output(struct server *server, struct wlr_output *wlr_output)
{
struct seat *seat = &server->seat;
wl_list_remove(&seat->new_input.link);
wl_list_remove(&seat->focus_change.link);
+ wl_list_remove(&seat->virtual_pointer_new.link);
+ wl_list_remove(&seat->virtual_keyboard_new.link);
struct input *input, *next;
wl_list_for_each_safe(input, next, &seat->inputs, link) {
wl_event_source_remove(sighup_source);
}
wl_display_destroy_clients(server->wl_display);
+
+ seat_finish(server);
+ output_finish(server);
+ xdg_shell_finish(server);
+ layers_finish(server);
+ kde_server_decoration_finish(server);
+ xdg_server_decoration_finish(server);
+ wl_list_remove(&server->new_constraint.link);
+ wl_list_remove(&server->output_power_manager_set_mode.link);
+ wl_list_remove(&server->tearing_new_object.link);
+
wlr_backend_destroy(server->backend);
wlr_allocator_destroy(server->allocator);
+
+ wl_list_remove(&server->renderer_lost.link);
wlr_renderer_destroy(server->renderer);
- seat_finish(server);
+
workspaces_destroy(server);
wlr_scene_node_destroy(&server->scene->tree.node);
+
wl_display_destroy(server->wl_display);
free(server->ssd_hover_state);
}
&server->xdg_activation_new_token);
}
+void
+xdg_shell_finish(struct server *server)
+{
+ wl_list_remove(&server->new_xdg_toplevel.link);
+ wl_list_remove(&server->xdg_activation_request.link);
+ wl_list_remove(&server->xdg_activation_new_token.link);
+}
xwayland_server_finish(struct server *server)
{
struct wlr_xwayland *xwayland = server->xwayland;
+ wl_list_remove(&server->xwayland_new_surface.link);
+ wl_list_remove(&server->xwayland_server_ready.link);
+ wl_list_remove(&server->xwayland_xwm_ready.link);
+
/*
* Reset server->xwayland to NULL first to prevent callbacks (like
* server_global_filter) from accessing it as it is destroyed