mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-01 22:58:38 -04:00
Clean up outputs on exit
This commit is contained in:
parent
579909a368
commit
c7f6981d9c
6 changed files with 34 additions and 9 deletions
|
|
@ -66,8 +66,21 @@ void output_add(struct wl_listener *listener, void *data) {
|
|||
|
||||
void output_remove(struct wl_listener *listener, void *data) {
|
||||
struct wlr_output *output = data;
|
||||
fprintf(stderr, "Output '%s' removed\n", output->name);
|
||||
// TODO: remove signal from state->output_frame
|
||||
struct output_state *ostate = NULL;
|
||||
struct state *state = wl_container_of(listener, state, output_remove);
|
||||
size_t i;
|
||||
for (i = 0; i < state->outputs->length; ++i) {
|
||||
struct output_state *_ostate = state->outputs->items[i];
|
||||
if (_ostate->output == output) {
|
||||
ostate = _ostate;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!ostate) {
|
||||
return; // We are unfamiliar with this output
|
||||
}
|
||||
list_del(state->outputs, i);
|
||||
wl_list_remove(&ostate->frame.link);
|
||||
}
|
||||
|
||||
int timer_done(void *data) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue