examples(xev): don't render in the eventCallback
This commit is contained in:
parent
d294428b74
commit
00afc7c130
2 changed files with 1 additions and 9 deletions
|
@ -92,7 +92,6 @@ fn eventCallback(
|
|||
event: vaxis.xev.Event,
|
||||
) xev.CallbackAction {
|
||||
const app = ud orelse unreachable;
|
||||
const writer = app.buffered_writer.writer().any();
|
||||
switch (event) {
|
||||
.key_press => |key| {
|
||||
if (key.matches('c', .{ .ctrl = true })) {
|
||||
|
@ -100,16 +99,9 @@ fn eventCallback(
|
|||
return .disarm;
|
||||
}
|
||||
},
|
||||
.winsize => |ws| watcher.vx.resize(app.allocator, writer, ws) catch @panic("TODO"),
|
||||
.winsize => |ws| watcher.vx.resize(app.allocator, watcher.tty.anyWriter(), ws) catch @panic("TODO"),
|
||||
else => {},
|
||||
}
|
||||
const win = watcher.vx.window();
|
||||
win.clear();
|
||||
watcher.vx.render(writer) catch {
|
||||
std.log.err("couldn't render", .{});
|
||||
return .disarm;
|
||||
};
|
||||
app.buffered_writer.flush() catch @panic("couldn't flush");
|
||||
return .rearm;
|
||||
}
|
||||
|
||||
|
|
BIN
temp.mp4
Normal file
BIN
temp.mp4
Normal file
Binary file not shown.
Loading…
Reference in a new issue