backend: destroy multi backend when primary backend is

This makes it easy for compositors to handle situations where the
DRM or libinput backend becomes unavailable. Compositors can listen
the destroy event of the multi backend returned by
wlr_backend_autocreate() and decide what to do.
This commit is contained in:
Simon Ser 2023-11-23 14:53:06 +01:00 committed by Kirill Primak
parent be0b7845f7
commit 4ad6e6c298
2 changed files with 67 additions and 2 deletions

View file

@ -37,6 +37,9 @@ struct wlr_backend {
*
* If session_ptr is not NULL, it's populated with the session which has been
* created with the backend, if any.
*
* The multi-backend will be destroyed if one of the primary underlying
* backends is destroyed (e.g. if the primary DRM device is unplugged).
*/
struct wlr_backend *wlr_backend_autocreate(struct wl_display *display,
struct wlr_session **session_ptr);