backend add and remove events
This commit is contained in:
parent
ee39dff1e7
commit
6c8fd6017e
|
@ -79,6 +79,9 @@ struct wlr_backend *wlr_multi_backend_create(struct wl_display *display) {
|
||||||
wl_list_init(&backend->backends);
|
wl_list_init(&backend->backends);
|
||||||
wlr_backend_init(&backend->backend, &backend_impl);
|
wlr_backend_init(&backend->backend, &backend_impl);
|
||||||
|
|
||||||
|
wl_signal_init(&backend->events.backend_add);
|
||||||
|
wl_signal_init(&backend->events.backend_remove);
|
||||||
|
|
||||||
return &backend->backend;
|
return &backend->backend;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,6 +165,8 @@ void wlr_multi_backend_add(struct wlr_backend *_multi,
|
||||||
|
|
||||||
wl_signal_add(&backend->events.output_remove, &sub->output_remove);
|
wl_signal_add(&backend->events.output_remove, &sub->output_remove);
|
||||||
sub->output_remove.notify = output_remove_reemit;
|
sub->output_remove.notify = output_remove_reemit;
|
||||||
|
|
||||||
|
wl_signal_emit(&multi->events.backend_add, backend);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wlr_multi_backend_remove(struct wlr_backend *_multi,
|
void wlr_multi_backend_remove(struct wlr_backend *_multi,
|
||||||
|
@ -173,6 +178,7 @@ void wlr_multi_backend_remove(struct wlr_backend *_multi,
|
||||||
multi_backend_get_subbackend(multi, backend);
|
multi_backend_get_subbackend(multi, backend);
|
||||||
|
|
||||||
if (sub) {
|
if (sub) {
|
||||||
|
wl_signal_emit(&multi->events.backend_remove, backend);
|
||||||
subbackend_state_destroy(sub);
|
subbackend_state_destroy(sub);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,11 @@ struct wlr_multi_backend {
|
||||||
struct wlr_backend backend;
|
struct wlr_backend backend;
|
||||||
|
|
||||||
struct wl_list backends;
|
struct wl_list backends;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
struct wl_signal backend_add;
|
||||||
|
struct wl_signal backend_remove;
|
||||||
|
} events;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue