mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 08:46:08 +03:00
padding needs to be sent to termio
This commit is contained in:
@ -586,7 +586,8 @@ fn sizeCallback(window: glfw.Window, width: i32, height: i32) void {
|
||||
_ = win.io_thread.mailbox.push(.{
|
||||
.resize = .{
|
||||
.grid_size = win.grid_size,
|
||||
.screen_size = screen_size.subPadding(win.padding),
|
||||
.screen_size = screen_size,
|
||||
.padding = win.padding,
|
||||
},
|
||||
}, .{ .forever = {} });
|
||||
win.io_thread.wakeup.send() catch {};
|
||||
|
@ -231,13 +231,16 @@ pub fn resize(
|
||||
self: *Exec,
|
||||
grid_size: renderer.GridSize,
|
||||
screen_size: renderer.ScreenSize,
|
||||
padding: renderer.Padding,
|
||||
) !void {
|
||||
const padded_size = screen_size.subPadding(padding);
|
||||
|
||||
// Update the size of our pty
|
||||
try self.pty.setSize(.{
|
||||
.ws_row = @intCast(u16, grid_size.rows),
|
||||
.ws_col = @intCast(u16, grid_size.columns),
|
||||
.ws_xpixel = @intCast(u16, screen_size.width),
|
||||
.ws_ypixel = @intCast(u16, screen_size.height),
|
||||
.ws_xpixel = @intCast(u16, padded_size.width),
|
||||
.ws_ypixel = @intCast(u16, padded_size.height),
|
||||
});
|
||||
|
||||
// Update our cached grid size
|
||||
|
@ -172,7 +172,7 @@ fn drainMailbox(self: *Thread) !void {
|
||||
|
||||
log.debug("mailbox message={}", .{message});
|
||||
switch (message) {
|
||||
.resize => |v| try self.impl.resize(v.grid_size, v.screen_size),
|
||||
.resize => |v| try self.impl.resize(v.grid_size, v.screen_size, v.padding),
|
||||
.write_small => |v| try self.impl.queueWrite(v.data[0..v.len]),
|
||||
.write_stable => |v| try self.impl.queueWrite(v),
|
||||
.write_alloc => |v| {
|
||||
|
@ -12,8 +12,16 @@ const terminal = @import("../terminal/main.zig");
|
||||
pub const Message = union(enum) {
|
||||
/// Resize the window.
|
||||
resize: struct {
|
||||
/// The grid size for the given screen size with padding applied.
|
||||
grid_size: renderer.GridSize,
|
||||
|
||||
/// The full screen (drawable) size. This does NOT include padding.
|
||||
/// This should be sent on to the renderer.
|
||||
screen_size: renderer.ScreenSize,
|
||||
|
||||
/// The padding, so that the terminal implementation can subtract
|
||||
/// this to send to the pty.
|
||||
padding: renderer.Padding,
|
||||
},
|
||||
|
||||
/// Write where the data fits in the union.
|
||||
|
Reference in New Issue
Block a user