mirror of
https://github.com/wizbright/waybox.git
synced 2025-10-29 05:40:20 -04:00
Got to exit cleanly and to work with wlroots 0.18 again
This commit is contained in:
parent
a6e9a04495
commit
b2e686171f
6 changed files with 34 additions and 16 deletions
|
|
@ -97,6 +97,7 @@ struct wb_server {
|
||||||
struct wl_listener new_input;
|
struct wl_listener new_input;
|
||||||
struct wl_listener new_output;
|
struct wl_listener new_output;
|
||||||
struct wl_listener output_configuration_applied;
|
struct wl_listener output_configuration_applied;
|
||||||
|
struct wl_listener output_configuration_tested;
|
||||||
struct wl_list outputs; /* wb_output::link */
|
struct wl_list outputs; /* wb_output::link */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -240,6 +240,14 @@ void wb_cursor_destroy(struct wb_cursor *cursor) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wl_list_remove(&cursor->request_cursor.link);
|
||||||
|
wl_list_remove(&cursor->cursor_motion.link);
|
||||||
|
wl_list_remove(&cursor->cursor_motion_absolute.link);
|
||||||
|
|
||||||
|
wl_list_remove(&cursor->cursor_button.link);
|
||||||
|
wl_list_remove(&cursor->cursor_axis.link);
|
||||||
|
wl_list_remove(&cursor->cursor_frame.link);
|
||||||
|
|
||||||
wlr_xcursor_manager_destroy(cursor->xcursor_manager);
|
wlr_xcursor_manager_destroy(cursor->xcursor_manager);
|
||||||
wlr_cursor_destroy(cursor->cursor);
|
wlr_cursor_destroy(cursor->cursor);
|
||||||
free(cursor);
|
free(cursor);
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
static void idle_inhibit_manager_destroy(struct wl_listener *listener, void *data) {
|
static void idle_inhibit_manager_destroy(struct wl_listener *listener, void *data) {
|
||||||
struct wb_server *server = wl_container_of(listener, server, destroy_inhibit_manager);
|
struct wb_server *server = wl_container_of(listener, server, destroy_inhibit_manager);
|
||||||
|
wl_list_remove(&server->new_inhibitor.link);
|
||||||
wl_list_remove(&server->inhibitors);
|
wl_list_remove(&server->inhibitors);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -11,6 +12,7 @@ static void idle_inhibitor_destroy(struct wl_listener *listener, void *data) {
|
||||||
struct wb_server *server = wl_container_of(listener, server, destroy_inhibitor);
|
struct wb_server *server = wl_container_of(listener, server, destroy_inhibitor);
|
||||||
/* wlroots will destroy the inhibitor after this callback, so this number will be 1 if the
|
/* wlroots will destroy the inhibitor after this callback, so this number will be 1 if the
|
||||||
* last inhibitor is being destroyed. */
|
* last inhibitor is being destroyed. */
|
||||||
|
wl_list_remove(&server->destroy_inhibitor.link);
|
||||||
wlr_idle_notifier_v1_set_inhibited(server->idle_notifier,
|
wlr_idle_notifier_v1_set_inhibited(server->idle_notifier,
|
||||||
wl_list_length(&server->inhibitors) > 1);
|
wl_list_length(&server->inhibitors) > 1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -204,6 +204,7 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
|
||||||
arrange_layers(surface->output);
|
arrange_layers(surface->output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wl_list_remove(&surface->new_popup.link);
|
||||||
wb_layer_surface_destroy(surface);
|
wb_layer_surface_destroy(surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,10 @@ void output_configuration_applied(struct wl_listener *listener, void *data) {
|
||||||
wlr_output_configuration_v1_send_succeeded(configuration);
|
wlr_output_configuration_v1_send_succeeded(configuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void output_configuration_tested(struct wl_listener *listener, void *data) {
|
||||||
|
output_configuration_applied(listener, data);
|
||||||
|
}
|
||||||
|
|
||||||
void output_request_state_notify(struct wl_listener *listener, void *data) {
|
void output_request_state_notify(struct wl_listener *listener, void *data) {
|
||||||
struct wb_output *output = wl_container_of(listener, output, request_state);
|
struct wb_output *output = wl_container_of(listener, output, request_state);
|
||||||
const struct wlr_output_event_request_state *event = data;
|
const struct wlr_output_event_request_state *event = data;
|
||||||
|
|
@ -175,5 +179,5 @@ void init_output(struct wb_server *server) {
|
||||||
server->wlr_output_manager = wlr_output_manager_v1_create(server->wl_display);
|
server->wlr_output_manager = wlr_output_manager_v1_create(server->wl_display);
|
||||||
server->output_configuration_applied.notify = output_configuration_applied;
|
server->output_configuration_applied.notify = output_configuration_applied;
|
||||||
wl_signal_add(&server->wlr_output_manager->events.apply, &server->output_configuration_applied);
|
wl_signal_add(&server->wlr_output_manager->events.apply, &server->output_configuration_applied);
|
||||||
wl_signal_add(&server->wlr_output_manager->events.test, &server->output_configuration_applied);
|
wl_signal_add(&server->wlr_output_manager->events.test, &server->output_configuration_tested);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -142,25 +142,27 @@ bool wb_terminate(struct wb_server* server) {
|
||||||
wlr_output_layout_destroy(server->output_layout);
|
wlr_output_layout_destroy(server->output_layout);
|
||||||
wlr_allocator_destroy(server->allocator);
|
wlr_allocator_destroy(server->allocator);
|
||||||
wlr_renderer_destroy(server->renderer);
|
wlr_renderer_destroy(server->renderer);
|
||||||
wlr_backend_destroy(server->backend);
|
|
||||||
wl_display_destroy(server->wl_display);
|
|
||||||
wb_seat_destroy(server->seat);
|
|
||||||
|
|
||||||
wl_list_remove(&server->gamma_control_set_gamma.link);
|
|
||||||
wl_list_remove(&server->new_layer_surface.link);
|
|
||||||
wl_list_remove(&server->new_xdg_decoration.link);
|
|
||||||
|
|
||||||
wl_list_remove(&server->destroy_inhibit_manager.link);
|
|
||||||
wl_list_remove(&server->destroy_inhibitor.link);
|
|
||||||
wl_list_remove(&server->new_inhibitor.link);
|
|
||||||
wl_list_remove(&server->inhibitors);
|
|
||||||
|
|
||||||
wl_list_remove(&server->new_xdg_toplevel.link);
|
|
||||||
wl_list_remove(&server->new_xdg_popup.link);
|
|
||||||
|
|
||||||
wl_list_remove(&server->new_input.link);
|
wl_list_remove(&server->new_input.link);
|
||||||
wl_list_remove(&server->new_output.link);
|
wl_list_remove(&server->new_output.link);
|
||||||
|
wl_list_remove(&server->output_configuration_applied.link);
|
||||||
|
wl_list_remove(&server->output_configuration_tested.link);
|
||||||
|
wl_list_remove(&server->new_inhibitor.link);
|
||||||
|
wl_list_remove(&server->inhibitors);
|
||||||
|
wl_list_remove(&server->destroy_inhibit_manager.link);
|
||||||
|
wl_list_remove(&server->gamma_control_set_gamma.link);
|
||||||
|
wl_list_remove(&server->new_layer_surface.link);
|
||||||
|
|
||||||
|
#if WLR_CHECK_VERSION(0, 18, 0)
|
||||||
|
wl_list_remove(&server->new_xdg_toplevel.link);
|
||||||
|
wl_list_remove(&server->new_xdg_popup.link);
|
||||||
|
#else
|
||||||
|
wl_list_remove(&server->new_xdg_surface.link);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
wlr_backend_destroy(server->backend);
|
||||||
|
wb_seat_destroy(server->seat);
|
||||||
|
wl_display_destroy(server->wl_display);
|
||||||
wlr_scene_node_destroy(&server->scene->tree.node);
|
wlr_scene_node_destroy(&server->scene->tree.node);
|
||||||
|
|
||||||
wlr_log(WLR_INFO, "%s", _("Display destroyed"));
|
wlr_log(WLR_INFO, "%s", _("Display destroyed"));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue