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/wl/output/root.zig | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/wl/output/root.zig') diff --git a/src/wl/output/root.zig b/src/wl/output/root.zig index ce2169f..f4ca36d 100644 --- a/src/wl/output/root.zig +++ b/src/wl/output/root.zig @@ -38,7 +38,7 @@ handle: wayland.Object.Ref, pub fn init( self: *Self, - ctx: *wayland.Context, + ctx: *const wayland.Context, ) !void { self.* = .{ .handle = try ctx.display.registry.add_object( @@ -58,7 +58,7 @@ pub const handler: wl.Registry.GlobalHandler = .{ .handler = register, }; -fn register(ctx: *wayland.Context) ?wayland.Object.Ref { +fn register(ctx: *const wayland.Context) ?wayland.Object.Ref { const output = ctx.allocator.create(Self) catch return null; output.init(ctx) catch return null; @@ -68,7 +68,7 @@ fn register(ctx: *wayland.Context) ?wayland.Object.Ref { fn geometry( self: *Self, - ctx: *wayland.Context, + ctx: *const wayland.Context, x: u32, y: u32, physical_width: u32, @@ -93,7 +93,7 @@ fn geometry( fn mode( self: *Self, - ctx: *wayland.Context, + ctx: *const wayland.Context, flags: Mode.Kind, width: u32, height: u32, @@ -108,7 +108,7 @@ fn mode( }; } -fn done(self: *Self, ctx: *wayland.Context) void { +fn done(self: *Self, ctx: *const wayland.Context) void { if (self.info) |info| { ctx.allocator.free(info.name); ctx.allocator.free(info.description); @@ -117,17 +117,17 @@ fn done(self: *Self, ctx: *wayland.Context) void { self.info = self.staging; } -fn scale(self: *Self, ctx: *wayland.Context, factor: u32) void { +fn scale(self: *Self, ctx: *const wayland.Context, factor: u32) void { _ = ctx; self.staging.scale = factor; } -fn name(self: *Self, ctx: *wayland.Context, n: []const u8) !void { +fn name(self: *Self, ctx: *const wayland.Context, n: []const u8) !void { self.staging.name = try ctx.allocator.alloc(u8, n.len); @memcpy(@constCast(self.staging.name), n); } -fn description(self: *Self, ctx: *wayland.Context, d: []const u8) !void { +fn description(self: *Self, ctx: *const wayland.Context, d: []const u8) !void { self.staging.description = try ctx.allocator.alloc(u8, d.len); @memcpy(@constCast(self.staging.description), d); } -- cgit v1.2.3-70-g09d2