mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
renderer: don't update frame if renderer grid size != terminal size
This commit is contained in:
@ -908,12 +908,14 @@ pub fn updateFrame(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If our terminal screen size doesn't match our expected renderer
|
// If our terminal screen size doesn't match our expected renderer
|
||||||
// size then we skip a frame. This can happen if we get resized
|
// size then we skip a frame. This can happen if the terminal state
|
||||||
// before the terminal gets resized. The terminal resize event also
|
// is resized between when the renderer mailbox is drained and when
|
||||||
// wakes up the renderer so we'll get another chance to update frame
|
// the state mutex is acquired inside this function.
|
||||||
// data.
|
//
|
||||||
if (self.cells.size.rows < state.terminal.rows or
|
// For some reason this doesn't seem to cause any significant issues
|
||||||
self.cells.size.columns < state.terminal.cols)
|
// with flickering while resizing. '\_('-')_/'
|
||||||
|
if (self.cells.size.rows != state.terminal.rows or
|
||||||
|
self.cells.size.columns != state.terminal.cols)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -739,6 +739,19 @@ pub fn updateFrame(
|
|||||||
self.foreground_color = bg;
|
self.foreground_color = bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If our terminal screen size doesn't match our expected renderer
|
||||||
|
// size then we skip a frame. This can happen if the terminal state
|
||||||
|
// is resized between when the renderer mailbox is drained and when
|
||||||
|
// the state mutex is acquired inside this function.
|
||||||
|
//
|
||||||
|
// For some reason this doesn't seem to cause any significant issues
|
||||||
|
// with flickering while resizing. '\_('-')_/'
|
||||||
|
if (self.grid_size.rows != state.terminal.rows or
|
||||||
|
self.grid_size.columns != state.terminal.cols)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Get the viewport pin so that we can compare it to the current.
|
// Get the viewport pin so that we can compare it to the current.
|
||||||
const viewport_pin = state.terminal.screen.pages.pin(.{ .viewport = .{} }).?;
|
const viewport_pin = state.terminal.screen.pages.pin(.{ .viewport = .{} }).?;
|
||||||
|
|
||||||
|
@ -522,6 +522,8 @@ fn renderCallback(
|
|||||||
t.flags.cursor_blink_visible,
|
t.flags.cursor_blink_visible,
|
||||||
) catch |err|
|
) catch |err|
|
||||||
log.warn("error rendering err={}", .{err});
|
log.warn("error rendering err={}", .{err});
|
||||||
|
|
||||||
|
// Draw
|
||||||
t.drawFrame(false);
|
t.drawFrame(false);
|
||||||
|
|
||||||
return .disarm;
|
return .disarm;
|
||||||
|
Reference in New Issue
Block a user