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/output/root.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/output/root.zig')
| -rw-r--r-- | src/wl/output/root.zig | 16 |
1 files changed, 8 insertions, 8 deletions
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); } |