renderer: fg/bg/cursor change must mark the screen as dirty

Fixes #2372
This commit is contained in:
Mitchell Hashimoto
2024-10-04 06:57:42 -10:00
parent c973ca6e03
commit 89fadfc202
3 changed files with 15 additions and 0 deletions

View File

@ -745,6 +745,12 @@ fn displayLinkCallback(
};
}
/// Mark the full screen as dirty so that we redraw everything.
pub fn markDirty(self: *Metal) void {
// This is how we force a full rebuild with metal.
self.cells_viewport = null;
}
/// Called when we get an updated display ID for our display link.
pub fn setMacOSDisplayID(self: *Metal, id: u32) !void {
if (comptime DisplayLink == void) return;

View File

@ -645,6 +645,12 @@ pub fn hasVsync(self: *const OpenGL) bool {
return false;
}
/// See Metal.
pub fn markDirty(self: *OpenGL) void {
// Do nothing, we don't have dirty tracking yet.
_ = self;
}
/// Callback when the focus changes for the terminal this is rendering.
///
/// Must be called on the render thread.

View File

@ -358,14 +358,17 @@ fn drainMailbox(self: *Thread) !void {
.foreground_color => |color| {
self.renderer.foreground_color = color;
self.renderer.markDirty();
},
.background_color => |color| {
self.renderer.background_color = color;
self.renderer.markDirty();
},
.cursor_color => |color| {
self.renderer.cursor_color = color;
self.renderer.markDirty();
},
.resize => |v| {