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.
This commit is contained in:
Rylee Lyman 2024-06-29 18:05:36 -04:00 committed by Tim Culverhouse
parent c213919849
commit 9c2d18d5a2

View file

@ -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 {