Skip to content

Commit

Permalink
fix: don't call the callback synchronously on watcher init
Browse files Browse the repository at this point in the history
This makes `xev.TtyWatcher` behave according to my expectations:
namely that the callback will only file after the function which
registers it has returned.
  • Loading branch information
robbielyman authored and rockorager committed Jun 30, 2024
1 parent c213919 commit 9c2d18d
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/xev.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 9c2d18d

Please sign in to comment.