backend/drm: make drm_lease implementation follow docs

This ensures compositors get a output_destroy signal when the
lease is granted and a new_output signal when the lease is revoked.
This commit is contained in:
Consolatis 2024-08-07 19:37:23 +02:00
parent c6de47d415
commit be555a9a99

View file

@ -1762,6 +1762,10 @@ void scan_drm_connectors(struct wlr_drm_backend *drm,
}
}
if (wlr_conn && wlr_conn->lease) {
continue;
}
// If the hotplug event contains a connector ID, ignore any other
// connector.
if (event != NULL && event->connector_id != 0 &&
@ -2150,6 +2154,7 @@ struct wlr_drm_lease *wlr_drm_create_lease(struct wlr_output **outputs,
get_drm_connector_from_output(outputs[i]);
conn->lease = lease;
conn->crtc->lease = lease;
disconnect_drm_connector(conn);
}
return lease;
@ -2186,4 +2191,5 @@ void drm_lease_destroy(struct wlr_drm_lease *lease) {
}
free(lease);
scan_drm_connectors(drm, NULL);
}