mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-19 06:59:48 -05:00
compositor: pass version in wlr_compositor_create
This allows wlroots to support newer versions of the interface without breaking the API.
This commit is contained in:
parent
87e7584dd4
commit
0bb574239d
6 changed files with 9 additions and 7 deletions
|
|
@ -1146,14 +1146,16 @@ static void compositor_handle_display_destroy(
|
|||
}
|
||||
|
||||
struct wlr_compositor *wlr_compositor_create(struct wl_display *display,
|
||||
struct wlr_renderer *renderer) {
|
||||
uint32_t version, struct wlr_renderer *renderer) {
|
||||
assert(version <= COMPOSITOR_VERSION);
|
||||
|
||||
struct wlr_compositor *compositor = calloc(1, sizeof(*compositor));
|
||||
if (!compositor) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
compositor->global = wl_global_create(display, &wl_compositor_interface,
|
||||
COMPOSITOR_VERSION, compositor, compositor_bind);
|
||||
version, compositor, compositor_bind);
|
||||
if (!compositor->global) {
|
||||
free(compositor);
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue