From 9c2d18d5a2396d220e5c956e18bedefb62f2cec6 Mon Sep 17 00:00:00 2001 From: Rylee Lyman Date: Sat, 29 Jun 2024 18:05:36 -0400 Subject: [PATCH] fix: don't call the callback synchronously on watcher init This makes `xev.TtyWatcher` behave according to my expectations: namely that the callback will only file after the function which registers it has returned. --- src/xev.zig | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/xev.zig b/src/xev.zig index 828623e..d0c0673 100644 --- a/src/xev.zig +++ b/src/xev.zig @@ -99,8 +99,6 @@ pub fn TtyWatcher(comptime Userdata: type) type { .callback = Self.signalCallback, }; try Tty.notifyWinsize(handler); - const winsize = try Tty.getWinsize(self.tty.fd); - _ = self.callback(self.ud, loop, self, .{ .winsize = winsize }); } fn signalCallback(ptr: *anyopaque) void {