diff --git a/main.zig b/main.zig index 66ba77b..cea64a1 100644 --- a/main.zig +++ b/main.zig @@ -1110,7 +1110,7 @@ const State = struct { return &self.config.args.options; } - fn stuff(self: *Self) !void { + fn run(self: *Self) !void { while (self.running) { if (self.dpy.dispatch() != .SUCCESS) return error.DispatchFailed; } @@ -1157,6 +1157,9 @@ const State = struct { } self.ally.destroy(self.outputs); + // Make sure the compositor has unmapped our surfaces by the time we exit + _ = self.dpy.roundtrip(); + self.shm.destroy(); self.compositor.destroy(); self.layer_shell.destroy(); @@ -1181,7 +1184,7 @@ const Args = struct { border: u32 = 0x000000FF, selection: u32 = 0x00000000, choice: u32 = 0xFFFFFF40, - format: ?[]const u8 = null, + format: ?[]const u8 = "%x,%y %wx%h\n", @"font-family": ?[]const u8 = "sans-serif", @"border-weight": u32 = 2, @"single-point": bool = false, @@ -1271,7 +1274,7 @@ pub fn run(ally: std.mem.Allocator) !void { const init = try state.intoInit(); defer init.deinit(); - try init.stuff(); + try init.run(); } pub fn main() !void {