diff options
author | Tony Crisci <tony@dubstepdish.com> | 2018-02-14 14:51:51 -0500 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2018-02-14 14:51:51 -0500 |
commit | 7dfbf06de9a5659d4c73edf53c38ee07068a2877 (patch) | |
tree | ccf6d0147d57fd65bc742d8d576e01d2ab2f8249 /sway | |
parent | input device destroy (diff) | |
download | sway-7dfbf06de9a5659d4c73edf53c38ee07068a2877.tar.gz sway-7dfbf06de9a5659d4c73edf53c38ee07068a2877.tar.zst sway-7dfbf06de9a5659d4c73edf53c38ee07068a2877.zip |
output destroy
Diffstat (limited to 'sway')
-rw-r--r-- | sway/desktop/output.c | 12 | ||||
-rw-r--r-- | sway/server.c | 8 | ||||
-rw-r--r-- | sway/tree/container.c | 2 |
3 files changed, 11 insertions, 11 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index a650665f..16183870 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -243,8 +243,8 @@ static void output_frame_notify(struct wl_listener *listener, void *data) { | |||
243 | soutput->last_frame = now; | 243 | soutput->last_frame = now; |
244 | } | 244 | } |
245 | 245 | ||
246 | void output_add_notify(struct wl_listener *listener, void *data) { | 246 | void handle_new_output(struct wl_listener *listener, void *data) { |
247 | struct sway_server *server = wl_container_of(listener, server, output_add); | 247 | struct sway_server *server = wl_container_of(listener, server, new_output); |
248 | struct wlr_output *wlr_output = data; | 248 | struct wlr_output *wlr_output = data; |
249 | wlr_log(L_DEBUG, "New output %p: %s", wlr_output, wlr_output->name); | 249 | wlr_log(L_DEBUG, "New output %p: %s", wlr_output, wlr_output->name); |
250 | 250 | ||
@@ -269,12 +269,14 @@ void output_add_notify(struct wl_listener *listener, void *data) { | |||
269 | 269 | ||
270 | sway_input_manager_configure_xcursor(input_manager); | 270 | sway_input_manager_configure_xcursor(input_manager); |
271 | 271 | ||
272 | output->frame.notify = output_frame_notify; | ||
273 | wl_signal_add(&wlr_output->events.frame, &output->frame); | 272 | wl_signal_add(&wlr_output->events.frame, &output->frame); |
273 | output->frame.notify = output_frame_notify; | ||
274 | |||
275 | wl_signal_add(&wlr_output->events.destroy, &output->output_destroy); | ||
276 | output->output_destroy.notify = handle_output_destroy; | ||
274 | } | 277 | } |
275 | 278 | ||
276 | void output_remove_notify(struct wl_listener *listener, void *data) { | 279 | void handle_output_destroy(struct wl_listener *listener, void *data) { |
277 | struct sway_server *server = wl_container_of(listener, server, output_remove); | ||
278 | struct wlr_output *wlr_output = data; | 280 | struct wlr_output *wlr_output = data; |
279 | wlr_log(L_DEBUG, "Output %p %s removed", wlr_output, wlr_output->name); | 281 | wlr_log(L_DEBUG, "Output %p %s removed", wlr_output, wlr_output->name); |
280 | 282 | ||
diff --git a/sway/server.c b/sway/server.c index b5eb510b..0753d37e 100644 --- a/sway/server.c +++ b/sway/server.c | |||
@@ -48,12 +48,8 @@ bool server_init(struct sway_server *server) { | |||
48 | server->data_device_manager = | 48 | server->data_device_manager = |
49 | wlr_data_device_manager_create(server->wl_display); | 49 | wlr_data_device_manager_create(server->wl_display); |
50 | 50 | ||
51 | server->output_add.notify = output_add_notify; | 51 | server->new_output.notify = handle_new_output; |
52 | wl_signal_add(&server->backend->events.output_add, &server->output_add); | 52 | wl_signal_add(&server->backend->events.new_output, &server->new_output); |
53 | |||
54 | server->output_remove.notify = output_remove_notify; | ||
55 | wl_signal_add(&server->backend->events.output_remove, | ||
56 | &server->output_remove); | ||
57 | 53 | ||
58 | server->xdg_shell_v6 = wlr_xdg_shell_v6_create(server->wl_display); | 54 | server->xdg_shell_v6 = wlr_xdg_shell_v6_create(server->wl_display); |
59 | wl_signal_add(&server->xdg_shell_v6->events.new_surface, | 55 | wl_signal_add(&server->xdg_shell_v6->events.new_surface, |
diff --git a/sway/tree/container.c b/sway/tree/container.c index 48aabd86..1a468c19 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -235,6 +235,8 @@ swayc_t *destroy_output(swayc_t *output) { | |||
235 | } | 235 | } |
236 | } | 236 | } |
237 | 237 | ||
238 | wl_list_remove(&output->sway_output->output_destroy.link); | ||
239 | |||
238 | wlr_log(L_DEBUG, "OUTPUT: Destroying output '%s'", output->name); | 240 | wlr_log(L_DEBUG, "OUTPUT: Destroying output '%s'", output->name); |
239 | free_swayc(output); | 241 | free_swayc(output); |
240 | 242 | ||