From cc205d45df2ead98170816702ba117c1a7d2ea68 Mon Sep 17 00:00:00 2001
From: Janis <janis@nirgendwo.xyz>
Date: Wed, 21 Dec 2022 14:28:41 +0100
Subject: [PATCH] stuff

---
 main.zig | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

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 {