mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
renderer: fg/bg/cursor change must mark the screen as dirty
Fixes #2372
This commit is contained in:
@ -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.
|
/// Called when we get an updated display ID for our display link.
|
||||||
pub fn setMacOSDisplayID(self: *Metal, id: u32) !void {
|
pub fn setMacOSDisplayID(self: *Metal, id: u32) !void {
|
||||||
if (comptime DisplayLink == void) return;
|
if (comptime DisplayLink == void) return;
|
||||||
|
@ -645,6 +645,12 @@ pub fn hasVsync(self: *const OpenGL) bool {
|
|||||||
return false;
|
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.
|
/// Callback when the focus changes for the terminal this is rendering.
|
||||||
///
|
///
|
||||||
/// Must be called on the render thread.
|
/// Must be called on the render thread.
|
||||||
|
@ -358,14 +358,17 @@ fn drainMailbox(self: *Thread) !void {
|
|||||||
|
|
||||||
.foreground_color => |color| {
|
.foreground_color => |color| {
|
||||||
self.renderer.foreground_color = color;
|
self.renderer.foreground_color = color;
|
||||||
|
self.renderer.markDirty();
|
||||||
},
|
},
|
||||||
|
|
||||||
.background_color => |color| {
|
.background_color => |color| {
|
||||||
self.renderer.background_color = color;
|
self.renderer.background_color = color;
|
||||||
|
self.renderer.markDirty();
|
||||||
},
|
},
|
||||||
|
|
||||||
.cursor_color => |color| {
|
.cursor_color => |color| {
|
||||||
self.renderer.cursor_color = color;
|
self.renderer.cursor_color = color;
|
||||||
|
self.renderer.markDirty();
|
||||||
},
|
},
|
||||||
|
|
||||||
.resize => |v| {
|
.resize => |v| {
|
||||||
|
Reference in New Issue
Block a user