Replace custom code in example with `deserialize`

dev
LeRoyce Pearson 2023-08-12 17:41:36 -06:00
parent 1542a95499
commit 13b0ea6a6f
1 changed files with 2 additions and 3 deletions

View File

@ -201,9 +201,8 @@ pub fn main() !void {
}, },
} }
} else if (header.object_id == xdg_toplevel_id) { } else if (header.object_id == xdg_toplevel_id) {
// const event = try wayland.deserialize(wayland.xdg.Toplevel.Event, header, message_buffer.items); const event = try wayland.deserialize(wayland.xdg.Toplevel.Event, header, message_buffer.items);
// std.debug.print("<- {}\n", .{event}); std.debug.print("<- {}\n", .{event});
std.debug.print("<- xdg_toplevel@{} {s} {}\n", .{ header.object_id, @tagName(@as(std.meta.Tag(wayland.xdg.Toplevel.Event), @enumFromInt(header.size_and_opcode.opcode))), std.zig.fmtEscapes(std.mem.sliceAsBytes(message_buffer.items)) });
} else if (header.object_id == registry_done_id) { } else if (header.object_id == registry_done_id) {
done = true; done = true;
} else if (header.object_id == shm_id) { } else if (header.object_id == shm_id) {