mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
renderer: message uses new size struct
This commit is contained in:
@ -371,9 +371,10 @@ fn drainMailbox(self: *Thread) !void {
|
|||||||
self.renderer.markDirty();
|
self.renderer.markDirty();
|
||||||
},
|
},
|
||||||
|
|
||||||
.resize => |v| {
|
.resize => |v| try self.renderer.setScreenSize(
|
||||||
try self.renderer.setScreenSize(v.screen_size, v.padding);
|
v.screen,
|
||||||
},
|
v.padding,
|
||||||
|
),
|
||||||
|
|
||||||
.change_config => |config| {
|
.change_config => |config| {
|
||||||
defer config.alloc.destroy(config.thread);
|
defer config.alloc.destroy(config.thread);
|
||||||
|
@ -54,14 +54,8 @@ pub const Message = union(enum) {
|
|||||||
/// config file in response to an OSC 12 command.
|
/// config file in response to an OSC 12 command.
|
||||||
cursor_color: ?terminal.color.RGB,
|
cursor_color: ?terminal.color.RGB,
|
||||||
|
|
||||||
/// Changes the screen size.
|
/// Changes the size. The screen size might change, padding, grid, etc.
|
||||||
resize: struct {
|
resize: renderer.Size,
|
||||||
/// The full screen (drawable) size. This does NOT include padding.
|
|
||||||
screen_size: renderer.ScreenSize,
|
|
||||||
|
|
||||||
/// The explicit padding values.
|
|
||||||
padding: renderer.Padding,
|
|
||||||
},
|
|
||||||
|
|
||||||
/// The derived configuration to update the renderer with.
|
/// The derived configuration to update the renderer with.
|
||||||
change_config: struct {
|
change_config: struct {
|
||||||
|
@ -382,12 +382,7 @@ pub fn resize(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Mail the renderer so that it can update the GPU and re-render
|
// Mail the renderer so that it can update the GPU and re-render
|
||||||
_ = self.renderer_mailbox.push(.{
|
_ = self.renderer_mailbox.push(.{ .resize = size }, .{ .forever = {} });
|
||||||
.resize = .{
|
|
||||||
.screen_size = size.screen,
|
|
||||||
.padding = size.padding,
|
|
||||||
},
|
|
||||||
}, .{ .forever = {} });
|
|
||||||
self.renderer_wakeup.notify() catch {};
|
self.renderer_wakeup.notify() catch {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user