From b4070eb67e62dc20068f65c13c0a54200572f8eb Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 14 Oct 2023 14:11:15 -0700 Subject: [PATCH] renderer: unfocused cursor should always be fully opaque --- src/renderer/Metal.zig | 2 +- src/renderer/OpenGL.zig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/Metal.zig b/src/renderer/Metal.zig index 80e18aed2..c9885a73a 100644 --- a/src/renderer/Metal.zig +++ b/src/renderer/Metal.zig @@ -1422,7 +1422,7 @@ fn addCursor( }; const color = self.config.cursor_color orelse self.config.foreground; - const alpha: u8 = alpha: { + const alpha: u8 = if (!self.focused) 255 else alpha: { const alpha = 255 * self.config.cursor_opacity; break :alpha @intFromFloat(@ceil(alpha)); }; diff --git a/src/renderer/OpenGL.zig b/src/renderer/OpenGL.zig index bebbecf2f..210c654e0 100644 --- a/src/renderer/OpenGL.zig +++ b/src/renderer/OpenGL.zig @@ -873,7 +873,7 @@ fn addCursor( }; const color = self.config.cursor_color orelse self.config.foreground; - const alpha: u8 = alpha: { + const alpha: u8 = if (!self.focused) 255 else alpha: { const alpha = 255 * self.config.cursor_opacity; break :alpha @intFromFloat(@ceil(alpha)); };