aboutsummaryrefslogtreecommitdiff
path: root/rootston
diff options
context:
space:
mode:
Diffstat (limited to 'rootston')
-rw-r--r--rootston/output.c38
-rw-r--r--rootston/seat.c2
2 files changed, 27 insertions, 13 deletions
diff --git a/rootston/output.c b/rootston/output.c
index 8ef383c3..72925f91 100644
--- a/rootston/output.c
+++ b/rootston/output.c
@@ -514,12 +514,6 @@ damage_finish:
pixman_region32_fini(&damage);
}
-static void output_damage_handle_frame(struct wl_listener *listener,
- void *data) {
- struct roots_output *output = wl_container_of(listener, output, frame);
- render_output(output);
-}
-
void output_damage_whole(struct roots_output *output) {
wlr_output_damage_add_whole(output->damage);
}
@@ -681,19 +675,37 @@ static void set_mode(struct wlr_output *output,
}
}
-static void output_handle_destroy(struct wl_listener *listener, void *data) {
- struct roots_output *output = wl_container_of(listener, output, destroy);
-
+static void output_destroy(struct roots_output *output) {
// TODO: cursor
//example_config_configure_cursor(sample->config, sample->cursor,
// sample->compositor);
wl_list_remove(&output->link);
wl_list_remove(&output->destroy.link);
- wl_list_remove(&output->frame.link);
+ wl_list_remove(&output->damage_frame.link);
+ wl_list_remove(&output->damage_destroy.link);
free(output);
}
+static void output_handle_destroy(struct wl_listener *listener, void *data) {
+ struct roots_output *output = wl_container_of(listener, output, destroy);
+ output_destroy(output);
+}
+
+static void output_damage_handle_frame(struct wl_listener *listener,
+ void *data) {
+ struct roots_output *output =
+ wl_container_of(listener, output, damage_frame);
+ render_output(output);
+}
+
+static void output_damage_handle_destroy(struct wl_listener *listener,
+ void *data) {
+ struct roots_output *output =
+ wl_container_of(listener, output, damage_destroy);
+ output_destroy(output);
+}
+
void handle_new_output(struct wl_listener *listener, void *data) {
struct roots_desktop *desktop = wl_container_of(listener, desktop,
new_output);
@@ -722,8 +734,10 @@ void handle_new_output(struct wl_listener *listener, void *data) {
output->destroy.notify = output_handle_destroy;
wl_signal_add(&wlr_output->events.destroy, &output->destroy);
- output->frame.notify = output_damage_handle_frame;
- wl_signal_add(&output->damage->events.frame, &output->frame);
+ output->damage_frame.notify = output_damage_handle_frame;
+ wl_signal_add(&output->damage->events.frame, &output->damage_frame);
+ output->damage_destroy.notify = output_damage_handle_destroy;
+ wl_signal_add(&output->damage->events.destroy, &output->damage_destroy);
struct roots_output_config *output_config =
roots_config_get_output(config, wlr_output);
diff --git a/rootston/seat.c b/rootston/seat.c
index 38c26628..1b7d05c4 100644
--- a/rootston/seat.c
+++ b/rootston/seat.c
@@ -408,10 +408,10 @@ static void handle_keyboard_destroy(struct wl_listener *listener, void *data) {
struct roots_keyboard *keyboard =
wl_container_of(listener, keyboard, device_destroy);
struct roots_seat *seat = keyboard->seat;
- roots_keyboard_destroy(keyboard);
wl_list_remove(&keyboard->device_destroy.link);
wl_list_remove(&keyboard->keyboard_key.link);
wl_list_remove(&keyboard->keyboard_modifiers.link);
+ roots_keyboard_destroy(keyboard);
seat_update_capabilities(seat);
}