deps: update to latest zig-wayland and zig-wlroots

This commit is contained in:
Isaac Freund 2024-03-02 17:25:46 +01:00
parent 12e6833f31
commit 0eacde7d01
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11
4 changed files with 8 additions and 10 deletions

2
deps/zig-wayland vendored

@ -1 +1 @@
Subproject commit b9c6fcb8cab3a85c5583ef371055cb589b1e7b18
Subproject commit 70285787ce871a5f2bc91151a610f54b537c8857

2
deps/zig-wlroots vendored

@ -1 +1 @@
Subproject commit e7e49951662d346f0f522124f2138ecf9c44ded9
Subproject commit 4094b86f6ec705e2f3974406601ec986364e87a3

View File

@ -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);

View File

@ -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);