refactor(gui): trace wio events
This commit is contained in:
parent
4b4e2465c7
commit
27794ef4f2
1 changed files with 6 additions and 1 deletions
|
|
@ -439,6 +439,7 @@ fn wioLoop() void {
|
|||
// during createWindow. This ensures dpi_scale and win_size are correct before
|
||||
// the first reloadFont / sendResize, avoiding a brief render at the wrong scale.
|
||||
while (window.getEvent()) |event| {
|
||||
thespian.trace(thespian.channel.event, .{ "wio", "init", event });
|
||||
switch (event) {
|
||||
.scale => |s| dpi_scale = s,
|
||||
.size_physical => |sz| win_size = sz,
|
||||
|
|
@ -447,6 +448,7 @@ fn wioLoop() void {
|
|||
}
|
||||
|
||||
// Notify the tui that the window is ready
|
||||
thespian.trace(thespian.channel.event, .{ "wio", "WindowCreated", win_size.width, win_size.height });
|
||||
reloadFont();
|
||||
sendResize(win_size, &state, &cell_width, &cell_height);
|
||||
tui_pid.send(.{ "RDR", "WindowCreated", @as(usize, 0) }) catch {};
|
||||
|
|
@ -463,6 +465,7 @@ fn wioLoop() void {
|
|||
maybeReloadFont(win_size, &state, &cell_width, &cell_height);
|
||||
|
||||
while (window.getEvent()) |event| {
|
||||
thespian.trace(thespian.channel.event, .{ "wio", "event", event });
|
||||
switch (event) {
|
||||
.close => {
|
||||
running = false;
|
||||
|
|
@ -579,7 +582,9 @@ fn wioLoop() void {
|
|||
held_buttons = .{};
|
||||
tui_pid.send(.{"focus_out"}) catch {};
|
||||
},
|
||||
else => {},
|
||||
else => {
|
||||
std.log.debug("wio unhandled event: {}", .{event});
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue