commit b31fa92c7f1ae820380e5a61304062d4005e444a
parent a01a330bcf3313b17a69b40308054759c3d9e6c1
Author: Michael Forney <mforney@mforney.org>
Date: Wed, 18 Dec 2019 16:25:55 -0800
compositor, surface: Implement protocol version 4 (damage_buffer)
We don't support buffer scaling, so handle this the same way as
damage.
Diffstat:
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/libswc/compositor.c b/libswc/compositor.c
@@ -776,8 +776,8 @@ bind_compositor(struct wl_client *client, void *data, uint32_t version, uint32_t
{
struct wl_resource *resource;
- if (version > 3)
- version = 3;
+ if (version > 4)
+ version = 4;
resource = wl_resource_create(client, &wl_compositor_interface, version, id);
wl_resource_set_implementation(resource, &compositor_impl, NULL, NULL);
@@ -789,7 +789,7 @@ compositor_initialize(void)
struct screen *screen;
uint32_t keysym;
- compositor.global = wl_global_create(swc.display, &wl_compositor_interface, 3, NULL, &bind_compositor);
+ compositor.global = wl_global_create(swc.display, &wl_compositor_interface, 4, NULL, &bind_compositor);
if (!compositor.global)
return false;
diff --git a/libswc/surface.c b/libswc/surface.c
@@ -273,6 +273,12 @@ set_buffer_scale(struct wl_client *client, struct wl_resource *surface, int32_t
/* TODO: Implement */
}
+static void
+damage_buffer(struct wl_client *client, struct wl_resource *surface, int32_t x, int32_t y, int32_t w, int32_t h)
+{
+ damage(client, surface, x, y, w, h);
+}
+
static struct wl_surface_interface surface_impl = {
.destroy = destroy_resource,
.attach = attach,
@@ -283,6 +289,7 @@ static struct wl_surface_interface surface_impl = {
.commit = commit,
.set_buffer_transform = set_buffer_transform,
.set_buffer_scale = set_buffer_scale,
+ .damage_buffer = damage_buffer,
};
static void