diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2025-08-27 09:02:43 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2025-08-27 09:03:21 +0200 |
| commit | 8a7392dea729d3ed49a8bf8eee25906c4fd616ac (patch) | |
| tree | 09e0b2fa96c60a2e0c8b0cae9e631bd2dc66f52f /src/wl/registry.zig | |
| parent | c217e7ec5cddfc002c4582fb5d52727aee843a7d (diff) | |
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.
Diffstat (limited to 'src/wl/registry.zig')
| -rw-r--r-- | src/wl/registry.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wl/registry.zig b/src/wl/registry.zig index 6c8ebdc..0939d17 100644 --- a/src/wl/registry.zig +++ b/src/wl/registry.zig @@ -18,7 +18,7 @@ pub const Request = union(enum) { pub const GlobalHandler = struct { interface: []const u8, version: u32, - handler: *const fn (ctx: *wayland.Context) ?wayland.Object.Ref, + handler: *const fn (ctx: *const wayland.Context) ?wayland.Object.Ref, }; objects: std.ArrayListUnmanaged(?wayland.Object) = .empty, @@ -52,7 +52,7 @@ pub fn add_object( self: *Self, allocator: std.mem.Allocator, object: wayland.Object, -) !usize { +) !wayland.Object.Ref { for (self.objects.items[1..], 1..) |obj, index| { if (obj == null) { self.objects.items[index] = object; @@ -83,7 +83,7 @@ pub fn get(self: *Self, handle: usize) ?*wayland.Object { fn global( self: *Self, - ctx: *wayland.Context, + ctx: *const wayland.Context, name: u32, interface: []const u8, version: u32, @@ -105,7 +105,7 @@ fn global( fn global_remove( self: *Self, - ctx: *wayland.Context, + ctx: *const wayland.Context, name: u32, ) void { _ = self; |