From 8a7392dea729d3ed49a8bf8eee25906c4fd616ac Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Wed, 27 Aug 2025 09:02:43 +0200 Subject: Add ancillary data mechanism to send fds to compositor. Currently we are just attaching the fds to the object id. In theory this is not a valid implementation, since if we have more than MAX_FD file descriptors this will not work. But since this wont be the case in basically all cases of the wayland protocol, we can just ignore that for now. --- src/event-set.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/event-set.zig') diff --git a/src/event-set.zig b/src/event-set.zig index 27c28bf..da17734 100644 --- a/src/event-set.zig +++ b/src/event-set.zig @@ -3,7 +3,7 @@ const wayland = @import("root.zig"); pub fn EventSet(T: type, events: anytype) type { return struct { - pub fn on_event(ptr: *anyopaque, ctx: *wayland.Context, opcode: u16, args: []const u8) void { + pub fn on_event(ptr: *anyopaque, ctx: *const wayland.Context, opcode: u16, args: []const u8) void { var offset: usize = 0; inline for (events, 0..) |event, index| { if (@TypeOf(event) != @TypeOf(null) and index == opcode) { @@ -66,7 +66,7 @@ test { a: u32 = 0, b: u32 = 0, - pub fn something(self: *@This(), _: *wayland.Context, a: u32, b: u32) void { + pub fn something(self: *@This(), _: *const wayland.Context, a: u32, b: u32) void { self.a = a; self.b = b; } -- cgit v1.2.3-70-g09d2