Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git
deps: update to latest zig-wayland and zig-wlroots
deps/zig-wayland | 2 +-
deps/zig-wlroots | 2 +-
river/InputConfig.zig | 12 +++++-------
river/InputDevice.zig | 2 +-
4 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/deps/zig-wayland b/deps/zig-wayland
index b9c6fcb..7028578 160000
--- a/deps/zig-wayland
+++ b/deps/zig-wayland
@@ -1 +1 @@
-Subproject commit b9c6fcb8cab3a85c5583ef371055cb589b1e7b18
+Subproject commit 70285787ce871a5f2bc91151a610f54b537c8857
diff --git a/deps/zig-wlroots b/deps/zig-wlroots
index e7e4995..4094b86 160000
--- a/deps/zig-wlroots
+++ b/deps/zig-wlroots
@@ -1 +1 @@
-Subproject commit e7e49951662d346f0f522124f2138ecf9c44ded9
+Subproject commit 4094b86f6ec705e2f3974406601ec986364e87a3
diff --git a/river/InputConfig.zig b/river/InputConfig.zig
index c3644cc..05b12d9 100644
--- a/river/InputConfig.zig
+++ b/river/InputConfig.zig
@@ -217,7 +217,7 @@ pub const ScrollButton = struct {
pub const MapToOutput = struct {
output_name: ?[]const u8,
- fn apply(map_to_output: MapToOutput, device: *wlr.InputDevice) void {
+ fn apply(map_to_output: MapToOutput, device: *InputDevice) void {
const wlr_output = blk: {
if (map_to_output.output_name) |name| {
var it = server.root.active_outputs.iterator(.forward);
@@ -230,16 +230,14 @@ pub const MapToOutput = struct {
break :blk null;
};
- switch (device.type) {
+ switch (device.wlr_device.type) {
.pointer, .touch, .tablet_tool => {
log.debug("mapping input '{s}' -> '{s}'", .{
- device.name,
+ device.identifier,
if (wlr_output) |o| o.name else "<no output>",
});
- // TODO: support multiple seats
- const seat = server.input_manager.defaultSeat();
- seat.cursor.wlr_cursor.mapInputToOutput(device, wlr_output);
+ device.seat.cursor.wlr_cursor.mapInputToOutput(device.wlr_device, wlr_output);
},
// These devices do not support being mapped to outputs.
@@ -283,7 +281,7 @@ pub fn apply(self: *const Self, device: *InputDevice) void {
if (comptime mem.eql(u8, field.name, "glob")) continue;
if (comptime mem.eql(u8, field.name, "map-to-output")) {
- @field(self, field.name).apply(device.wlr_device);
+ @field(self, field.name).apply(device);
} else if (@field(self, field.name)) |setting| {
log.debug("applying setting: {s}", .{field.name});
setting.apply(libinput_device);
diff --git a/river/InputDevice.zig b/river/InputDevice.zig
index 7742c6a..7443d5f 100644
--- a/river/InputDevice.zig
+++ b/river/InputDevice.zig
@@ -59,7 +59,7 @@ pub fn init(device: *InputDevice, seat: *Seat, wlr_device: *wlr.InputDevice) !vo
device_type,
wlr_device.vendor,
wlr_device.product,
- mem.trim(u8, mem.sliceTo(wlr_device.name, 0), &ascii.whitespace),
+ mem.trim(u8, mem.sliceTo(wlr_device.name orelse "unknown", 0), &ascii.whitespace),
},
);
errdefer util.gpa.free(identifier);