diff options
author | Simon Ser <contact@emersion.fr> | 2022-11-15 16:43:04 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2022-11-15 16:43:04 +0100 |
commit | bf623ec78222b2ed432d92251216dfb6baa33f81 (patch) | |
tree | a88c8cf59c5718ecaa7c8b2114ed6dbf111346d1 | |
parent | 3ef68a484243555b020200c6f95246d994932c3f (diff) |
content-type-v1: add version param to wlr_content_type_manager_v1_create()
-rw-r--r-- | include/wlr/types/wlr_content_type_v1.h | 2 | ||||
-rw-r--r-- | types/wlr_content_type_v1.c | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/include/wlr/types/wlr_content_type_v1.h b/include/wlr/types/wlr_content_type_v1.h index 3de39367..6fa13d9b 100644 --- a/include/wlr/types/wlr_content_type_v1.h +++ b/include/wlr/types/wlr_content_type_v1.h @@ -29,7 +29,7 @@ struct wlr_content_type_manager_v1 { }; struct wlr_content_type_manager_v1 *wlr_content_type_manager_v1_create( - struct wl_display *display); + struct wl_display *display, uint32_t version); enum wp_content_type_v1_type wlr_surface_get_content_type_v1( struct wlr_content_type_manager_v1 *manager, struct wlr_surface *surface); diff --git a/types/wlr_content_type_v1.c b/types/wlr_content_type_v1.c index 037228be..36996ce9 100644 --- a/types/wlr_content_type_v1.c +++ b/types/wlr_content_type_v1.c @@ -157,15 +157,16 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) { } struct wlr_content_type_manager_v1 *wlr_content_type_manager_v1_create( - struct wl_display *display) { + struct wl_display *display, uint32_t version) { + assert(version <= CONTENT_TYPE_VERSION); + struct wlr_content_type_manager_v1 *manager = calloc(1, sizeof(*manager)); if (manager == NULL) { return NULL; } manager->global = wl_global_create(display, - &wp_content_type_manager_v1_interface, CONTENT_TYPE_VERSION, - manager, manager_bind); + &wp_content_type_manager_v1_interface, version, manager, manager_bind); if (manager->global == NULL) { free(manager); return NULL; |