commit d730855

Michael Forney  ·  2023-05-23 04:16:45 +0000 UTC
parent a7b6155
Implement wl_output version 3
1 files changed,  +6, -2
+6, -2
 1@@ -11,6 +11,10 @@
 2 #include <drm.h>
 3 #include <xf86drm.h>
 4 
 5+static const struct wl_output_interface output_impl = {
 6+	.release = destroy_resource,
 7+};
 8+
 9 static void
10 bind_output(struct wl_client *client, void *data, uint32_t version, uint32_t id)
11 {
12@@ -27,7 +31,7 @@ bind_output(struct wl_client *client, void *data, uint32_t version, uint32_t id)
13 		return;
14 	}
15 
16-	wl_resource_set_implementation(resource, NULL, output, &remove_resource);
17+	wl_resource_set_implementation(resource, &output_impl, output, &remove_resource);
18 	wl_list_insert(&output->resources, wl_resource_get_link(resource));
19 
20 	wl_output_send_geometry(resource, screen->base.geometry.x, screen->base.geometry.y,
21@@ -60,7 +64,7 @@ output_new(drmModeConnectorPtr connector)
22 		goto error0;
23 	}
24 
25-	output->global = wl_global_create(swc.display, &wl_output_interface, 2, output, &bind_output);
26+	output->global = wl_global_create(swc.display, &wl_output_interface, 3, output, &bind_output);
27 
28 	if (!output->global) {
29 		ERROR("Failed to create output global\n");