renderer: message uses new size struct

This commit is contained in:
Mitchell Hashimoto
2024-11-14 13:34:12 -08:00
parent 90c59f2462
commit 6f62944b9c
3 changed files with 7 additions and 17 deletions

View File

@ -371,9 +371,10 @@ fn drainMailbox(self: *Thread) !void {
self.renderer.markDirty();
},
.resize => |v| {
try self.renderer.setScreenSize(v.screen_size, v.padding);
},
.resize => |v| try self.renderer.setScreenSize(
v.screen,
v.padding,
),
.change_config => |config| {
defer config.alloc.destroy(config.thread);

View File

@ -54,14 +54,8 @@ pub const Message = union(enum) {
/// config file in response to an OSC 12 command.
cursor_color: ?terminal.color.RGB,
/// Changes the screen size.
resize: struct {
/// The full screen (drawable) size. This does NOT include padding.
screen_size: renderer.ScreenSize,
/// The explicit padding values.
padding: renderer.Padding,
},
/// Changes the size. The screen size might change, padding, grid, etc.
resize: renderer.Size,
/// The derived configuration to update the renderer with.
change_config: struct {

View File

@ -382,12 +382,7 @@ pub fn resize(
}
// Mail the renderer so that it can update the GPU and re-render
_ = self.renderer_mailbox.push(.{
.resize = .{
.screen_size = size.screen,
.padding = size.padding,
},
}, .{ .forever = {} });
_ = self.renderer_mailbox.push(.{ .resize = size }, .{ .forever = {} });
self.renderer_wakeup.notify() catch {};
}