From a02364cbefe0cb718679ec49543c979aa1a134cc Mon Sep 17 00:00:00 2001 From: Justy Null Date: Fri, 19 Sep 2025 22:23:32 -0700 Subject: [PATCH 1/9] feat: add liquid glass background effect support --- .../Window Styles/TerminalWindow.swift | 61 +++++++++++++++++++ macos/Sources/Ghostty/Ghostty.Config.swift | 13 +++- src/config/Config.zig | 25 ++++++++ 3 files changed, 98 insertions(+), 1 deletion(-) diff --git a/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift b/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift index 160473328..69b4b3f1a 100644 --- a/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift +++ b/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift @@ -44,6 +44,9 @@ class TerminalWindow: NSWindow { true } + /// Glass effect view for liquid glass background when transparency is enabled + private var glassEffectView: NSView? + /// Gets the terminal controller from the window controller. var terminalController: TerminalController? { windowController as? TerminalController @@ -476,6 +479,11 @@ class TerminalWindow: NSWindow { // Terminal.app more easily. backgroundColor = .white.withAlphaComponent(0.001) + // Add liquid glass behind terminal content + if #available(macOS 26.0, *), derivedConfig.backgroundGlassStyle != "off" { + setupGlassLayer() + } + if let appDelegate = NSApp.delegate as? AppDelegate { ghostty_set_window_background_blur( appDelegate.ghostty.app, @@ -484,6 +492,11 @@ class TerminalWindow: NSWindow { } else { isOpaque = true + // Remove liquid glass when not transparent + if #available(macOS 26.0, *) { + removeGlassLayer() + } + let backgroundColor = preferredBackgroundColor ?? NSColor(surfaceConfig.backgroundColor) self.backgroundColor = backgroundColor.withAlphaComponent(1) } @@ -562,6 +575,51 @@ class TerminalWindow: NSWindow { } } + // MARK: Glass + + @available(macOS 26.0, *) + private func setupGlassLayer() { + guard let contentView = contentView else { return } + + // Remove existing glass effect view + glassEffectView?.removeFromSuperview() + + // Get the window content view (parent of the NSHostingView) + guard let windowContentView = contentView.superview else { return } + + // Create NSGlassEffectView for native glass effect + let effectView = NSGlassEffectView() + + // Map Ghostty config to NSGlassEffectView style + let glassStyle = derivedConfig.backgroundGlassStyle + switch glassStyle { + case "regular": + effectView.style = NSGlassEffectView.Style.regular + case "clear": + effectView.style = NSGlassEffectView.Style.clear + default: + // Should not reach here since we check for "off" before calling setupGlassLayer() + return + } + + effectView.cornerRadius = 18 + effectView.tintColor = preferredBackgroundColor + + effectView.frame = windowContentView.bounds + effectView.autoresizingMask = [.width, .height] + + // Position BELOW the terminal content to act as background + windowContentView.addSubview(effectView, positioned: .below, relativeTo: contentView) + glassEffectView = effectView + } + + @available(macOS 26.0, *) + private func removeGlassLayer() { + glassEffectView?.removeFromSuperview() + glassEffectView = nil + } + +>>>>>>> Conflict 4 of 4 ends // MARK: Config struct DerivedConfig { @@ -569,12 +627,14 @@ class TerminalWindow: NSWindow { let backgroundColor: NSColor let backgroundOpacity: Double let macosWindowButtons: Ghostty.MacOSWindowButtons + let backgroundGlassStyle: String init() { self.title = nil self.backgroundColor = NSColor.windowBackgroundColor self.backgroundOpacity = 1 self.macosWindowButtons = .visible + self.backgroundGlassStyle = "off" } init(_ config: Ghostty.Config) { @@ -582,6 +642,7 @@ class TerminalWindow: NSWindow { self.backgroundColor = NSColor(config.backgroundColor) self.backgroundOpacity = config.backgroundOpacity self.macosWindowButtons = config.macosWindowButtons + self.backgroundGlassStyle = config.backgroundGlassStyle } } } diff --git a/macos/Sources/Ghostty/Ghostty.Config.swift b/macos/Sources/Ghostty/Ghostty.Config.swift index 2df0a8656..20629c58f 100644 --- a/macos/Sources/Ghostty/Ghostty.Config.swift +++ b/macos/Sources/Ghostty/Ghostty.Config.swift @@ -261,6 +261,17 @@ extension Ghostty { return MacOSWindowButtons(rawValue: str) ?? defaultValue } + var backgroundGlassStyle: String { + let defaultValue = "off" + guard let config = self.config else { return defaultValue } + var v: UnsafePointer? = nil + let key = "background-glass-style" + guard ghostty_config_get(config, &v, key, UInt(key.count)) else { return defaultValue } + guard let ptr = v else { return defaultValue } + return String(cString: ptr) + } + + var macosTitlebarStyle: String { let defaultValue = "transparent" guard let config = self.config else { return defaultValue } @@ -635,7 +646,7 @@ extension Ghostty.Config { static let title = BellFeatures(rawValue: 1 << 3) static let border = BellFeatures(rawValue: 1 << 4) } - + enum MacDockDropBehavior: String { case new_tab = "new-tab" case new_window = "new-window" diff --git a/src/config/Config.zig b/src/config/Config.zig index 1deb3e532..b542bcb1d 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -950,6 +950,24 @@ palette: Palette = .{}, /// doing so. @"background-blur": BackgroundBlur = .false, +/// The style of the glass effect when `background-opacity` is less than 1 +/// and the terminal is using a modern glass effect (macOS 26.0+ only). +/// +/// Valid values are: +/// +/// * `off` - No glass effect +/// * `regular` - Standard glass effect with some opacity +/// * `clear` - Highly transparent glass effect +/// +/// This setting only takes effect on macOS 26.0+ when transparency is enabled +/// (`background-opacity` < 1). On older macOS versions or when transparency +/// is disabled, this setting has no effect. +/// +/// The default value is `off`. +/// +/// Available since: 1.2.2 +@"background-glass-style": BackgroundGlassStyle = .off, + /// The opacity level (opposite of transparency) of an unfocused split. /// Unfocused splits by default are slightly faded out to make it easier to see /// which split is focused. To disable this feature, set this value to 1. @@ -8383,6 +8401,13 @@ pub const BackgroundBlur = union(enum) { } }; +/// See background-glass-style +pub const BackgroundGlassStyle = enum { + off, + regular, + clear, +}; + /// See window-decoration pub const WindowDecoration = enum(c_int) { auto, From d40af61960b41652d11e45429cb41b42f40b50a9 Mon Sep 17 00:00:00 2001 From: Justy Null Date: Sat, 20 Sep 2025 11:44:04 -0700 Subject: [PATCH 2/9] refactor: migrate background glass effect to new macos-background-style config --- .../Window Styles/TerminalWindow.swift | 38 ++++++++----- macos/Sources/Ghostty/Ghostty.Config.swift | 10 ++-- macos/Sources/Ghostty/Package.swift | 17 ++++-- src/config/Config.zig | 54 ++++++++++--------- 4 files changed, 70 insertions(+), 49 deletions(-) diff --git a/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift b/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift index 69b4b3f1a..51f4d5b1c 100644 --- a/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift +++ b/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift @@ -480,11 +480,9 @@ class TerminalWindow: NSWindow { backgroundColor = .white.withAlphaComponent(0.001) // Add liquid glass behind terminal content - if #available(macOS 26.0, *), derivedConfig.backgroundGlassStyle != "off" { + if #available(macOS 26.0, *), derivedConfig.macosBackgroundStyle != .blur { setupGlassLayer() - } - - if let appDelegate = NSApp.delegate as? AppDelegate { + } else if let appDelegate = NSApp.delegate as? AppDelegate { ghostty_set_window_background_blur( appDelegate.ghostty.app, Unmanaged.passUnretained(self).toOpaque()) @@ -576,7 +574,7 @@ class TerminalWindow: NSWindow { } // MARK: Glass - + @available(macOS 26.0, *) private func setupGlassLayer() { guard let contentView = contentView else { return } @@ -591,18 +589,18 @@ class TerminalWindow: NSWindow { let effectView = NSGlassEffectView() // Map Ghostty config to NSGlassEffectView style - let glassStyle = derivedConfig.backgroundGlassStyle - switch glassStyle { - case "regular": + let backgroundStyle = derivedConfig.macosBackgroundStyle + switch backgroundStyle { + case .regularGlass: effectView.style = NSGlassEffectView.Style.regular - case "clear": + case .clearGlass: effectView.style = NSGlassEffectView.Style.clear default: - // Should not reach here since we check for "off" before calling setupGlassLayer() + // Should not reach here since we check for "default" before calling setupGlassLayer() return } - effectView.cornerRadius = 18 + effectView.cornerRadius = derivedConfig.windowCornerRadius effectView.tintColor = preferredBackgroundColor effectView.frame = windowContentView.bounds @@ -627,14 +625,16 @@ class TerminalWindow: NSWindow { let backgroundColor: NSColor let backgroundOpacity: Double let macosWindowButtons: Ghostty.MacOSWindowButtons - let backgroundGlassStyle: String + let macosBackgroundStyle: Ghostty.MacBackgroundStyle + let windowCornerRadius: CGFloat init() { self.title = nil self.backgroundColor = NSColor.windowBackgroundColor self.backgroundOpacity = 1 self.macosWindowButtons = .visible - self.backgroundGlassStyle = "off" + self.macosBackgroundStyle = .blur + self.windowCornerRadius = 16 } init(_ config: Ghostty.Config) { @@ -642,7 +642,17 @@ class TerminalWindow: NSWindow { self.backgroundColor = NSColor(config.backgroundColor) self.backgroundOpacity = config.backgroundOpacity self.macosWindowButtons = config.macosWindowButtons - self.backgroundGlassStyle = config.backgroundGlassStyle + self.macosBackgroundStyle = config.macosBackgroundStyle + + // Set corner radius based on macos-titlebar-style + // Native, transparent, and hidden styles use 16pt radius + // Tabs style uses 20pt radius + switch config.macosTitlebarStyle { + case "tabs": + self.windowCornerRadius = 20 + default: + self.windowCornerRadius = 16 + } } } } diff --git a/macos/Sources/Ghostty/Ghostty.Config.swift b/macos/Sources/Ghostty/Ghostty.Config.swift index 20629c58f..1488b0790 100644 --- a/macos/Sources/Ghostty/Ghostty.Config.swift +++ b/macos/Sources/Ghostty/Ghostty.Config.swift @@ -261,17 +261,17 @@ extension Ghostty { return MacOSWindowButtons(rawValue: str) ?? defaultValue } - var backgroundGlassStyle: String { - let defaultValue = "off" + var macosBackgroundStyle: MacBackgroundStyle { + let defaultValue = MacBackgroundStyle.blur guard let config = self.config else { return defaultValue } var v: UnsafePointer? = nil - let key = "background-glass-style" + let key = "macos-background-style" guard ghostty_config_get(config, &v, key, UInt(key.count)) else { return defaultValue } guard let ptr = v else { return defaultValue } - return String(cString: ptr) + let str = String(cString: ptr) + return MacBackgroundStyle(rawValue: str) ?? defaultValue } - var macosTitlebarStyle: String { let defaultValue = "transparent" guard let config = self.config else { return defaultValue } diff --git a/macos/Sources/Ghostty/Package.swift b/macos/Sources/Ghostty/Package.swift index 258857e8e..e769b814e 100644 --- a/macos/Sources/Ghostty/Package.swift +++ b/macos/Sources/Ghostty/Package.swift @@ -56,7 +56,7 @@ extension Ghostty { case app case zig_run } - + /// Returns the mechanism that launched the app. This is based on an env var so /// its up to the env var being set in the correct circumstance. static var launchSource: LaunchSource { @@ -65,7 +65,7 @@ extension Ghostty { // source. If its unset we assume we're in a CLI environment. return .cli } - + // If the env var is set but its unknown then we default back to the app. return LaunchSource(rawValue: envValue) ?? .app } @@ -76,17 +76,17 @@ extension Ghostty { extension Ghostty { class AllocatedString { private let cString: ghostty_string_s - + init(_ c: ghostty_string_s) { self.cString = c } - + var string: String { guard let ptr = cString.ptr else { return "" } let data = Data(bytes: ptr, count: Int(cString.len)) return String(data: data, encoding: .utf8) ?? "" } - + deinit { ghostty_string_free(cString) } @@ -352,6 +352,13 @@ extension Ghostty { case hidden } + /// Enum for the macos-background-style config option + enum MacBackgroundStyle: String { + case blur + case regularGlass = "regular-glass" + case clearGlass = "clear-glass" + } + /// Enum for auto-update-channel config option enum AutoUpdateChannel: String { case tip diff --git a/src/config/Config.zig b/src/config/Config.zig index b542bcb1d..287efa89d 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -950,24 +950,6 @@ palette: Palette = .{}, /// doing so. @"background-blur": BackgroundBlur = .false, -/// The style of the glass effect when `background-opacity` is less than 1 -/// and the terminal is using a modern glass effect (macOS 26.0+ only). -/// -/// Valid values are: -/// -/// * `off` - No glass effect -/// * `regular` - Standard glass effect with some opacity -/// * `clear` - Highly transparent glass effect -/// -/// This setting only takes effect on macOS 26.0+ when transparency is enabled -/// (`background-opacity` < 1). On older macOS versions or when transparency -/// is disabled, this setting has no effect. -/// -/// The default value is `off`. -/// -/// Available since: 1.2.2 -@"background-glass-style": BackgroundGlassStyle = .off, - /// The opacity level (opposite of transparency) of an unfocused split. /// Unfocused splits by default are slightly faded out to make it easier to see /// which split is focused. To disable this feature, set this value to 1. @@ -3124,6 +3106,28 @@ keybind: Keybinds = .{}, /// Available since: 1.2.0 @"macos-shortcuts": MacShortcuts = .ask, +/// The background style for macOS windows when `background-opacity` is less than 1. +/// This controls the visual effect applied behind the terminal background. +/// +/// Valid values are: +/// +/// * `blur` - Uses the standard background behavior. The `background-blur` +/// configuration will control whether blur is applied (available on all macOS versions) +/// * `regular-glass` - Standard glass effect with some opacity (macOS 26.0+ only) +/// * `clear-glass` - Highly transparent glass effect (macOS 26.0+ only) +/// +/// The `blur` option does not force any blur effect - it simply respects the +/// `background-blur` configuration. The glass options override `background-blur` +/// and apply their own visual effects. +/// +/// On macOS versions prior to 26.0, only `blur` has an effect. The glass +/// options will fall back to `blur` behavior on older versions. +/// +/// The default value is `blur`. +/// +/// Available since: 1.2.2 +@"macos-background-style": MacBackgroundStyle = .blur, + /// Put every surface (tab, split, window) into a dedicated Linux cgroup. /// /// This makes it so that resource management can be done on a per-surface @@ -7708,6 +7712,13 @@ pub const MacShortcuts = enum { ask, }; +/// See macos-background-style +pub const MacBackgroundStyle = enum { + blur, + @"regular-glass", + @"clear-glass", +}; + /// See gtk-single-instance pub const GtkSingleInstance = enum { false, @@ -8401,13 +8412,6 @@ pub const BackgroundBlur = union(enum) { } }; -/// See background-glass-style -pub const BackgroundGlassStyle = enum { - off, - regular, - clear, -}; - /// See window-decoration pub const WindowDecoration = enum(c_int) { auto, From 45aceace726656e49e145c2f0fa504eb97e80e2e Mon Sep 17 00:00:00 2001 From: Justy Null Date: Sat, 20 Sep 2025 16:05:05 -0700 Subject: [PATCH 3/9] fix: disable renderer background when macOS effects are enabled --- .../Window Styles/TerminalWindow.swift | 4 ++-- macos/Sources/Ghostty/Ghostty.Config.swift | 2 +- macos/Sources/Ghostty/Package.swift | 2 +- src/config/Config.zig | 15 +++---------- src/renderer/generic.zig | 22 +++++++++++++++++-- 5 files changed, 27 insertions(+), 18 deletions(-) diff --git a/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift b/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift index 51f4d5b1c..07deb6ded 100644 --- a/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift +++ b/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift @@ -480,7 +480,7 @@ class TerminalWindow: NSWindow { backgroundColor = .white.withAlphaComponent(0.001) // Add liquid glass behind terminal content - if #available(macOS 26.0, *), derivedConfig.macosBackgroundStyle != .blur { + if #available(macOS 26.0, *), derivedConfig.macosBackgroundStyle != .defaultStyle { setupGlassLayer() } else if let appDelegate = NSApp.delegate as? AppDelegate { ghostty_set_window_background_blur( @@ -633,7 +633,7 @@ class TerminalWindow: NSWindow { self.backgroundColor = NSColor.windowBackgroundColor self.backgroundOpacity = 1 self.macosWindowButtons = .visible - self.macosBackgroundStyle = .blur + self.macosBackgroundStyle = .defaultStyle self.windowCornerRadius = 16 } diff --git a/macos/Sources/Ghostty/Ghostty.Config.swift b/macos/Sources/Ghostty/Ghostty.Config.swift index 1488b0790..4a80f2af8 100644 --- a/macos/Sources/Ghostty/Ghostty.Config.swift +++ b/macos/Sources/Ghostty/Ghostty.Config.swift @@ -262,7 +262,7 @@ extension Ghostty { } var macosBackgroundStyle: MacBackgroundStyle { - let defaultValue = MacBackgroundStyle.blur + let defaultValue = MacBackgroundStyle.defaultStyle guard let config = self.config else { return defaultValue } var v: UnsafePointer? = nil let key = "macos-background-style" diff --git a/macos/Sources/Ghostty/Package.swift b/macos/Sources/Ghostty/Package.swift index e769b814e..4279cc012 100644 --- a/macos/Sources/Ghostty/Package.swift +++ b/macos/Sources/Ghostty/Package.swift @@ -354,7 +354,7 @@ extension Ghostty { /// Enum for the macos-background-style config option enum MacBackgroundStyle: String { - case blur + case defaultStyle = "default" case regularGlass = "regular-glass" case clearGlass = "clear-glass" } diff --git a/src/config/Config.zig b/src/config/Config.zig index 287efa89d..09731b13d 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -3111,22 +3111,13 @@ keybind: Keybinds = .{}, /// /// Valid values are: /// -/// * `blur` - Uses the standard background behavior. The `background-blur` +/// * `default` - Uses the standard background behavior. The `background-blur` /// configuration will control whether blur is applied (available on all macOS versions) /// * `regular-glass` - Standard glass effect with some opacity (macOS 26.0+ only) /// * `clear-glass` - Highly transparent glass effect (macOS 26.0+ only) /// -/// The `blur` option does not force any blur effect - it simply respects the -/// `background-blur` configuration. The glass options override `background-blur` -/// and apply their own visual effects. -/// -/// On macOS versions prior to 26.0, only `blur` has an effect. The glass -/// options will fall back to `blur` behavior on older versions. -/// -/// The default value is `blur`. -/// /// Available since: 1.2.2 -@"macos-background-style": MacBackgroundStyle = .blur, +@"macos-background-style": MacBackgroundStyle = .default, /// Put every surface (tab, split, window) into a dedicated Linux cgroup. /// @@ -7714,7 +7705,7 @@ pub const MacShortcuts = enum { /// See macos-background-style pub const MacBackgroundStyle = enum { - blur, + default, @"regular-glass", @"clear-glass", }; diff --git a/src/renderer/generic.zig b/src/renderer/generic.zig index 8c55da602..013761f1e 100644 --- a/src/renderer/generic.zig +++ b/src/renderer/generic.zig @@ -561,6 +561,7 @@ pub fn Renderer(comptime GraphicsAPI: type) type { vsync: bool, colorspace: configpkg.Config.WindowColorspace, blending: configpkg.Config.AlphaBlending, + macos_background_style: configpkg.Config.MacBackgroundStyle, pub fn init( alloc_gpa: Allocator, @@ -633,6 +634,7 @@ pub fn Renderer(comptime GraphicsAPI: type) type { .vsync = config.@"window-vsync", .colorspace = config.@"window-colorspace", .blending = config.@"alpha-blending", + .macos_background_style = config.@"macos-background-style", .arena = arena, }; } @@ -644,6 +646,16 @@ pub fn Renderer(comptime GraphicsAPI: type) type { } }; + /// Determines if the terminal background should be disabled based on platform and config. + /// On macOS, when background effects are enabled (background style != default), the effect + /// layer handles the background rendering instead of the terminal renderer. + fn shouldDisableBackground(config: DerivedConfig) bool { + return switch (builtin.os.tag) { + .macos => config.macos_background_style != .default, + else => false, + }; + } + pub fn init(alloc: Allocator, options: renderer.Options) !Self { // Initialize our graphics API wrapper, this will prepare the // surface provided by the apprt and set up any API-specific @@ -716,7 +728,10 @@ pub fn Renderer(comptime GraphicsAPI: type) type { options.config.background.r, options.config.background.g, options.config.background.b, - @intFromFloat(@round(options.config.background_opacity * 255.0)), + if (shouldDisableBackground(options.config)) + 0 + else + @intFromFloat(@round(options.config.background_opacity * 255.0)), }, .bools = .{ .cursor_wide = false, @@ -1293,7 +1308,10 @@ pub fn Renderer(comptime GraphicsAPI: type) type { self.terminal_state.colors.background.r, self.terminal_state.colors.background.g, self.terminal_state.colors.background.b, - @intFromFloat(@round(self.config.background_opacity * 255.0)), + if (shouldDisableBackground(self.config)) + 0 + else + @intFromFloat(@round(self.config.background_opacity * 255.0)), }; } } From d5c378cd6bb8541b7e6d914e1fc7900a257171f9 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 12 Oct 2025 13:18:15 -0700 Subject: [PATCH 4/9] minor style tweaks --- .../Terminal/Window Styles/TerminalWindow.swift | 5 +++-- src/config/Config.zig | 13 ++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift b/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift index 07deb6ded..444ce28bd 100644 --- a/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift +++ b/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift @@ -573,6 +573,7 @@ class TerminalWindow: NSWindow { } } +#if compiler(>=6.2) // MARK: Glass @available(macOS 26.0, *) @@ -616,8 +617,8 @@ class TerminalWindow: NSWindow { glassEffectView?.removeFromSuperview() glassEffectView = nil } - ->>>>>>> Conflict 4 of 4 ends +#endif // compiler(>=6.2) + // MARK: Config struct DerivedConfig { diff --git a/src/config/Config.zig b/src/config/Config.zig index 09731b13d..0e7b51c4f 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -3106,17 +3106,20 @@ keybind: Keybinds = .{}, /// Available since: 1.2.0 @"macos-shortcuts": MacShortcuts = .ask, -/// The background style for macOS windows when `background-opacity` is less than 1. -/// This controls the visual effect applied behind the terminal background. +/// The background style for macOS windows when `background-opacity` is less +/// than 1. This controls the visual effect applied behind the terminal +/// background. /// /// Valid values are: /// /// * `default` - Uses the standard background behavior. The `background-blur` -/// configuration will control whether blur is applied (available on all macOS versions) -/// * `regular-glass` - Standard glass effect with some opacity (macOS 26.0+ only) +/// configuration will control whether blur is applied (available on +/// all macOS versions) +/// * `regular-glass` - Standard glass effect with some opacity (macOS +/// 26.0+ only) /// * `clear-glass` - Highly transparent glass effect (macOS 26.0+ only) /// -/// Available since: 1.2.2 +/// Available since: 1.3.0 @"macos-background-style": MacBackgroundStyle = .default, /// Put every surface (tab, split, window) into a dedicated Linux cgroup. From 42493de0989d1a2c27f5c27deb471c6e08d66ad6 Mon Sep 17 00:00:00 2001 From: Justy Null Date: Fri, 17 Oct 2025 18:39:11 -0700 Subject: [PATCH 5/9] fix: make titlebar transparent when using glass background style --- .../Terminal/Window Styles/TerminalWindow.swift | 3 +++ .../TransparentTitlebarTerminalWindow.swift | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift b/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift index 444ce28bd..6105cac53 100644 --- a/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift +++ b/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift @@ -627,6 +627,7 @@ class TerminalWindow: NSWindow { let backgroundOpacity: Double let macosWindowButtons: Ghostty.MacOSWindowButtons let macosBackgroundStyle: Ghostty.MacBackgroundStyle + let macosTitlebarStyle: String let windowCornerRadius: CGFloat init() { @@ -635,6 +636,7 @@ class TerminalWindow: NSWindow { self.backgroundOpacity = 1 self.macosWindowButtons = .visible self.macosBackgroundStyle = .defaultStyle + self.macosTitlebarStyle = "transparent" self.windowCornerRadius = 16 } @@ -644,6 +646,7 @@ class TerminalWindow: NSWindow { self.backgroundOpacity = config.backgroundOpacity self.macosWindowButtons = config.macosWindowButtons self.macosBackgroundStyle = config.macosBackgroundStyle + self.macosTitlebarStyle = config.macosTitlebarStyle // Set corner radius based on macos-titlebar-style // Native, transparent, and hidden styles use 16pt radius diff --git a/macos/Sources/Features/Terminal/Window Styles/TransparentTitlebarTerminalWindow.swift b/macos/Sources/Features/Terminal/Window Styles/TransparentTitlebarTerminalWindow.swift index 08d56c83d..eea1956fc 100644 --- a/macos/Sources/Features/Terminal/Window Styles/TransparentTitlebarTerminalWindow.swift +++ b/macos/Sources/Features/Terminal/Window Styles/TransparentTitlebarTerminalWindow.swift @@ -88,7 +88,17 @@ class TransparentTitlebarTerminalWindow: TerminalWindow { // color of the titlebar in native fullscreen view. if let titlebarView = titlebarContainer?.firstDescendant(withClassName: "NSTitlebarView") { titlebarView.wantsLayer = true - titlebarView.layer?.backgroundColor = preferredBackgroundColor?.cgColor + + // For glass background styles, use a transparent titlebar to let the glass effect show through + // Only apply this for transparent and tabs titlebar styles + let isGlassStyle = derivedConfig.macosBackgroundStyle == .regularGlass || + derivedConfig.macosBackgroundStyle == .clearGlass + let isTransparentTitlebar = derivedConfig.macosTitlebarStyle == "transparent" || + derivedConfig.macosTitlebarStyle == "tabs" + + titlebarView.layer?.backgroundColor = (isGlassStyle && isTransparentTitlebar) + ? NSColor.clear.cgColor + : preferredBackgroundColor?.cgColor } // In all cases, we have to hide the background view since this has multiple subviews From bb2307116662bdf778906f48260524482fba2312 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 15 Dec 2025 10:29:21 -0800 Subject: [PATCH 6/9] config: change macos-background-style to be enums on background-blur --- macos/Sources/Ghostty/Ghostty.Config.swift | 52 +++++++++++++++++++-- src/config/Config.zig | 54 ++++++++++++++++++---- src/config/c_get.zig | 18 ++++++-- src/renderer/generic.zig | 5 +- 4 files changed, 109 insertions(+), 20 deletions(-) diff --git a/macos/Sources/Ghostty/Ghostty.Config.swift b/macos/Sources/Ghostty/Ghostty.Config.swift index 4a80f2af8..5a622d19c 100644 --- a/macos/Sources/Ghostty/Ghostty.Config.swift +++ b/macos/Sources/Ghostty/Ghostty.Config.swift @@ -413,12 +413,12 @@ extension Ghostty { return v; } - var backgroundBlurRadius: Int { - guard let config = self.config else { return 1 } - var v: Int = 0 + var backgroundBlur: BackgroundBlur { + guard let config = self.config else { return .disabled } + var v: Int16 = 0 let key = "background-blur" _ = ghostty_config_get(config, &v, key, UInt(key.lengthOfBytes(using: .utf8))) - return v; + return BackgroundBlur(fromCValue: v) } var unfocusedSplitOpacity: Double { @@ -637,6 +637,50 @@ extension Ghostty.Config { case download } + /// Background blur configuration that maps from the C API values. + /// Positive values represent blur radius, special negative values + /// represent macOS-specific glass effects. + enum BackgroundBlur: Equatable { + case disabled + case radius(Int) + case macosGlassRegular + case macosGlassClear + + init(fromCValue value: Int16) { + switch value { + case 0: + self = .disabled + case -1: + self = .macosGlassRegular + case -2: + self = .macosGlassClear + default: + self = .radius(Int(value)) + } + } + + var isEnabled: Bool { + switch self { + case .disabled: + return false + default: + return true + } + } + + /// Returns the blur radius if applicable, nil for glass effects. + var radius: Int? { + switch self { + case .disabled: + return nil + case .radius(let r): + return r + case .macosGlassRegular, .macosGlassClear: + return nil + } + } + } + struct BellFeatures: OptionSet { let rawValue: CUnsignedInt diff --git a/src/config/Config.zig b/src/config/Config.zig index 0e7b51c4f..4a3810901 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -8338,6 +8338,8 @@ pub const AutoUpdate = enum { pub const BackgroundBlur = union(enum) { false, true, + @"macos-glass-regular", + @"macos-glass-clear", radius: u8, pub fn parseCLI(self: *BackgroundBlur, input: ?[]const u8) !void { @@ -8347,14 +8349,35 @@ pub const BackgroundBlur = union(enum) { return; }; - self.* = if (cli.args.parseBool(input_)) |b| - if (b) .true else .false - else |_| - .{ .radius = std.fmt.parseInt( - u8, - input_, - 0, - ) catch return error.InvalidValue }; + // Try to parse normal bools + if (cli.args.parseBool(input_)) |b| { + self.* = if (b) .true else .false; + return; + } else |_| {} + + // Try to parse enums + if (std.meta.stringToEnum( + std.meta.Tag(BackgroundBlur), + input_, + )) |v| switch (v) { + inline else => |tag| tag: { + // We can only parse void types + const info = std.meta.fieldInfo(BackgroundBlur, tag); + if (info.type != void) break :tag; + self.* = @unionInit( + BackgroundBlur, + @tagName(tag), + {}, + ); + return; + }, + }; + + self.* = .{ .radius = std.fmt.parseInt( + u8, + input_, + 0, + ) catch return error.InvalidValue }; } pub fn enabled(self: BackgroundBlur) bool { @@ -8365,11 +8388,16 @@ pub const BackgroundBlur = union(enum) { }; } - pub fn cval(self: BackgroundBlur) u8 { + pub fn cval(self: BackgroundBlur) i16 { return switch (self) { .false => 0, .true => 20, .radius => |v| v, + // I hate sentinel values like this but this is only for + // our macOS application currently. We can switch to a proper + // tagged union if we ever need to. + .@"macos-glass-regular" => -1, + .@"macos-glass-clear" => -2, }; } @@ -8381,6 +8409,8 @@ pub const BackgroundBlur = union(enum) { .false => try formatter.formatEntry(bool, false), .true => try formatter.formatEntry(bool, true), .radius => |v| try formatter.formatEntry(u8, v), + .@"macos-glass-regular" => try formatter.formatEntry([]const u8, "macos-glass-regular"), + .@"macos-glass-clear" => try formatter.formatEntry([]const u8, "macos-glass-clear"), } } @@ -8400,6 +8430,12 @@ pub const BackgroundBlur = union(enum) { try v.parseCLI("42"); try testing.expectEqual(42, v.radius); + try v.parseCLI("macos-glass-regular"); + try testing.expectEqual(.@"macos-glass-regular", v); + + try v.parseCLI("macos-glass-clear"); + try testing.expectEqual(.@"macos-glass-clear", v); + try testing.expectError(error.InvalidValue, v.parseCLI("")); try testing.expectError(error.InvalidValue, v.parseCLI("aaaa")); try testing.expectError(error.InvalidValue, v.parseCLI("420")); diff --git a/src/config/c_get.zig b/src/config/c_get.zig index f235f596a..0f8f897a2 100644 --- a/src/config/c_get.zig +++ b/src/config/c_get.zig @@ -193,20 +193,32 @@ test "c_get: background-blur" { { c.@"background-blur" = .false; - var cval: u8 = undefined; + var cval: i16 = undefined; try testing.expect(get(&c, .@"background-blur", @ptrCast(&cval))); try testing.expectEqual(0, cval); } { c.@"background-blur" = .true; - var cval: u8 = undefined; + var cval: i16 = undefined; try testing.expect(get(&c, .@"background-blur", @ptrCast(&cval))); try testing.expectEqual(20, cval); } { c.@"background-blur" = .{ .radius = 42 }; - var cval: u8 = undefined; + var cval: i16 = undefined; try testing.expect(get(&c, .@"background-blur", @ptrCast(&cval))); try testing.expectEqual(42, cval); } + { + c.@"background-blur" = .@"macos-glass-regular"; + var cval: i16 = undefined; + try testing.expect(get(&c, .@"background-blur", @ptrCast(&cval))); + try testing.expectEqual(-1, cval); + } + { + c.@"background-blur" = .@"macos-glass-clear"; + var cval: i16 = undefined; + try testing.expect(get(&c, .@"background-blur", @ptrCast(&cval))); + try testing.expectEqual(-2, cval); + } } diff --git a/src/renderer/generic.zig b/src/renderer/generic.zig index 013761f1e..e3db3cd93 100644 --- a/src/renderer/generic.zig +++ b/src/renderer/generic.zig @@ -728,10 +728,7 @@ pub fn Renderer(comptime GraphicsAPI: type) type { options.config.background.r, options.config.background.g, options.config.background.b, - if (shouldDisableBackground(options.config)) - 0 - else - @intFromFloat(@round(options.config.background_opacity * 255.0)), + @intFromFloat(@round(options.config.background_opacity * 255.0)), }, .bools = .{ .cursor_wide = false, From a6ddf03a2ee5aec49bb4a4488e3061d8bd737839 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 15 Dec 2025 10:48:20 -0800 Subject: [PATCH 7/9] remove the macos-background-style config --- .../Window Styles/TerminalWindow.swift | 17 +++++----- .../TransparentTitlebarTerminalWindow.swift | 3 +- macos/Sources/Ghostty/Ghostty.Config.swift | 21 ++++++------ macos/Sources/Ghostty/Package.swift | 7 ---- src/config/Config.zig | 29 ++++------------ src/renderer/generic.zig | 33 ++++++++++--------- 6 files changed, 42 insertions(+), 68 deletions(-) diff --git a/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift b/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift index 6105cac53..7066f7bd6 100644 --- a/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift +++ b/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift @@ -480,7 +480,7 @@ class TerminalWindow: NSWindow { backgroundColor = .white.withAlphaComponent(0.001) // Add liquid glass behind terminal content - if #available(macOS 26.0, *), derivedConfig.macosBackgroundStyle != .defaultStyle { + if #available(macOS 26.0, *), derivedConfig.backgroundBlur.isGlassStyle { setupGlassLayer() } else if let appDelegate = NSApp.delegate as? AppDelegate { ghostty_set_window_background_blur( @@ -590,14 +590,13 @@ class TerminalWindow: NSWindow { let effectView = NSGlassEffectView() // Map Ghostty config to NSGlassEffectView style - let backgroundStyle = derivedConfig.macosBackgroundStyle - switch backgroundStyle { - case .regularGlass: + switch derivedConfig.backgroundBlur { + case .macosGlassRegular: effectView.style = NSGlassEffectView.Style.regular - case .clearGlass: + case .macosGlassClear: effectView.style = NSGlassEffectView.Style.clear default: - // Should not reach here since we check for "default" before calling setupGlassLayer() + // Should not reach here since we check for glass style before calling setupGlassLayer() return } @@ -623,10 +622,10 @@ class TerminalWindow: NSWindow { struct DerivedConfig { let title: String? + let backgroundBlur: Ghostty.Config.BackgroundBlur let backgroundColor: NSColor let backgroundOpacity: Double let macosWindowButtons: Ghostty.MacOSWindowButtons - let macosBackgroundStyle: Ghostty.MacBackgroundStyle let macosTitlebarStyle: String let windowCornerRadius: CGFloat @@ -635,7 +634,7 @@ class TerminalWindow: NSWindow { self.backgroundColor = NSColor.windowBackgroundColor self.backgroundOpacity = 1 self.macosWindowButtons = .visible - self.macosBackgroundStyle = .defaultStyle + self.backgroundBlur = .disabled self.macosTitlebarStyle = "transparent" self.windowCornerRadius = 16 } @@ -645,7 +644,7 @@ class TerminalWindow: NSWindow { self.backgroundColor = NSColor(config.backgroundColor) self.backgroundOpacity = config.backgroundOpacity self.macosWindowButtons = config.macosWindowButtons - self.macosBackgroundStyle = config.macosBackgroundStyle + self.backgroundBlur = config.backgroundBlur self.macosTitlebarStyle = config.macosTitlebarStyle // Set corner radius based on macos-titlebar-style diff --git a/macos/Sources/Features/Terminal/Window Styles/TransparentTitlebarTerminalWindow.swift b/macos/Sources/Features/Terminal/Window Styles/TransparentTitlebarTerminalWindow.swift index eea1956fc..57b889b82 100644 --- a/macos/Sources/Features/Terminal/Window Styles/TransparentTitlebarTerminalWindow.swift +++ b/macos/Sources/Features/Terminal/Window Styles/TransparentTitlebarTerminalWindow.swift @@ -91,8 +91,7 @@ class TransparentTitlebarTerminalWindow: TerminalWindow { // For glass background styles, use a transparent titlebar to let the glass effect show through // Only apply this for transparent and tabs titlebar styles - let isGlassStyle = derivedConfig.macosBackgroundStyle == .regularGlass || - derivedConfig.macosBackgroundStyle == .clearGlass + let isGlassStyle = derivedConfig.backgroundBlur.isGlassStyle let isTransparentTitlebar = derivedConfig.macosTitlebarStyle == "transparent" || derivedConfig.macosTitlebarStyle == "tabs" diff --git a/macos/Sources/Ghostty/Ghostty.Config.swift b/macos/Sources/Ghostty/Ghostty.Config.swift index 5a622d19c..47826a104 100644 --- a/macos/Sources/Ghostty/Ghostty.Config.swift +++ b/macos/Sources/Ghostty/Ghostty.Config.swift @@ -261,17 +261,6 @@ extension Ghostty { return MacOSWindowButtons(rawValue: str) ?? defaultValue } - var macosBackgroundStyle: MacBackgroundStyle { - let defaultValue = MacBackgroundStyle.defaultStyle - guard let config = self.config else { return defaultValue } - var v: UnsafePointer? = nil - let key = "macos-background-style" - guard ghostty_config_get(config, &v, key, UInt(key.count)) else { return defaultValue } - guard let ptr = v else { return defaultValue } - let str = String(cString: ptr) - return MacBackgroundStyle(rawValue: str) ?? defaultValue - } - var macosTitlebarStyle: String { let defaultValue = "transparent" guard let config = self.config else { return defaultValue } @@ -668,6 +657,16 @@ extension Ghostty.Config { } } + /// Returns true if this is a macOS glass style (regular or clear). + var isGlassStyle: Bool { + switch self { + case .macosGlassRegular, .macosGlassClear: + return true + default: + return false + } + } + /// Returns the blur radius if applicable, nil for glass effects. var radius: Int? { switch self { diff --git a/macos/Sources/Ghostty/Package.swift b/macos/Sources/Ghostty/Package.swift index 4279cc012..b834ea31f 100644 --- a/macos/Sources/Ghostty/Package.swift +++ b/macos/Sources/Ghostty/Package.swift @@ -352,13 +352,6 @@ extension Ghostty { case hidden } - /// Enum for the macos-background-style config option - enum MacBackgroundStyle: String { - case defaultStyle = "default" - case regularGlass = "regular-glass" - case clearGlass = "clear-glass" - } - /// Enum for auto-update-channel config option enum AutoUpdateChannel: String { case tip diff --git a/src/config/Config.zig b/src/config/Config.zig index 4a3810901..18224a3cd 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -927,6 +927,12 @@ palette: Palette = .{}, /// reasonable for a good looking blur. Higher blur intensities may /// cause strange rendering and performance issues. /// +/// On macOS 26.0 and later, there are additional special values that +/// can be set to use the native macOS glass effects: +/// +/// * `macos-glass-regular` - Standard glass effect with some opacity +/// * `macos-glass-clear` - Highly transparent glass effect +/// /// Supported on macOS and on some Linux desktop environments, including: /// /// * KDE Plasma (Wayland and X11) @@ -3106,22 +3112,6 @@ keybind: Keybinds = .{}, /// Available since: 1.2.0 @"macos-shortcuts": MacShortcuts = .ask, -/// The background style for macOS windows when `background-opacity` is less -/// than 1. This controls the visual effect applied behind the terminal -/// background. -/// -/// Valid values are: -/// -/// * `default` - Uses the standard background behavior. The `background-blur` -/// configuration will control whether blur is applied (available on -/// all macOS versions) -/// * `regular-glass` - Standard glass effect with some opacity (macOS -/// 26.0+ only) -/// * `clear-glass` - Highly transparent glass effect (macOS 26.0+ only) -/// -/// Available since: 1.3.0 -@"macos-background-style": MacBackgroundStyle = .default, - /// Put every surface (tab, split, window) into a dedicated Linux cgroup. /// /// This makes it so that resource management can be done on a per-surface @@ -7706,13 +7696,6 @@ pub const MacShortcuts = enum { ask, }; -/// See macos-background-style -pub const MacBackgroundStyle = enum { - default, - @"regular-glass", - @"clear-glass", -}; - /// See gtk-single-instance pub const GtkSingleInstance = enum { false, diff --git a/src/renderer/generic.zig b/src/renderer/generic.zig index e3db3cd93..39eec7b43 100644 --- a/src/renderer/generic.zig +++ b/src/renderer/generic.zig @@ -561,7 +561,7 @@ pub fn Renderer(comptime GraphicsAPI: type) type { vsync: bool, colorspace: configpkg.Config.WindowColorspace, blending: configpkg.Config.AlphaBlending, - macos_background_style: configpkg.Config.MacBackgroundStyle, + background_blur: configpkg.Config.BackgroundBlur, pub fn init( alloc_gpa: Allocator, @@ -634,7 +634,7 @@ pub fn Renderer(comptime GraphicsAPI: type) type { .vsync = config.@"window-vsync", .colorspace = config.@"window-colorspace", .blending = config.@"alpha-blending", - .macos_background_style = config.@"macos-background-style", + .background_blur = config.@"background-blur", .arena = arena, }; } @@ -646,16 +646,6 @@ pub fn Renderer(comptime GraphicsAPI: type) type { } }; - /// Determines if the terminal background should be disabled based on platform and config. - /// On macOS, when background effects are enabled (background style != default), the effect - /// layer handles the background rendering instead of the terminal renderer. - fn shouldDisableBackground(config: DerivedConfig) bool { - return switch (builtin.os.tag) { - .macos => config.macos_background_style != .default, - else => false, - }; - } - pub fn init(alloc: Allocator, options: renderer.Options) !Self { // Initialize our graphics API wrapper, this will prepare the // surface provided by the apprt and set up any API-specific @@ -728,6 +718,9 @@ pub fn Renderer(comptime GraphicsAPI: type) type { options.config.background.r, options.config.background.g, options.config.background.b, + // Note that if we're on macOS with glass effects + // we'll disable background opacity but we handle + // that in updateFrame. @intFromFloat(@round(options.config.background_opacity * 255.0)), }, .bools = .{ @@ -1305,10 +1298,18 @@ pub fn Renderer(comptime GraphicsAPI: type) type { self.terminal_state.colors.background.r, self.terminal_state.colors.background.g, self.terminal_state.colors.background.b, - if (shouldDisableBackground(self.config)) - 0 - else - @intFromFloat(@round(self.config.background_opacity * 255.0)), + @intFromFloat(@round(self.config.background_opacity * 255.0)), + }; + + // If we're on macOS and have glass styles, we remove + // the background opacity because the glass effect handles + // it. + if (comptime builtin.os.tag == .macos) switch (self.config.background_blur) { + .@"macos-glass-regular", + .@"macos-glass-clear", + => self.uniforms.bg_color[3] = 0, + + else => {}, }; } } From 8482e0777db9f675641c5567d562f5f4d43b5fc4 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 15 Dec 2025 10:58:35 -0800 Subject: [PATCH 8/9] macos: remove glass view on syncAppearance with blur --- .../Window Styles/TerminalWindow.swift | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift b/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift index 7066f7bd6..0c0ac0646 100644 --- a/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift +++ b/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift @@ -483,6 +483,11 @@ class TerminalWindow: NSWindow { if #available(macOS 26.0, *), derivedConfig.backgroundBlur.isGlassStyle { setupGlassLayer() } else if let appDelegate = NSApp.delegate as? AppDelegate { + // If we had a prior glass layer we should remove it + if #available(macOS 26.0, *) { + removeGlassLayer() + } + ghostty_set_window_background_blur( appDelegate.ghostty.app, Unmanaged.passUnretained(self).toOpaque()) @@ -578,12 +583,11 @@ class TerminalWindow: NSWindow { @available(macOS 26.0, *) private func setupGlassLayer() { - guard let contentView = contentView else { return } - // Remove existing glass effect view - glassEffectView?.removeFromSuperview() - + removeGlassLayer() + // Get the window content view (parent of the NSHostingView) + guard let contentView else { return } guard let windowContentView = contentView.superview else { return } // Create NSGlassEffectView for native glass effect @@ -596,13 +600,13 @@ class TerminalWindow: NSWindow { case .macosGlassClear: effectView.style = NSGlassEffectView.Style.clear default: - // Should not reach here since we check for glass style before calling setupGlassLayer() - return + // Should not reach here since we check for glass style before calling + // setupGlassLayer() + assertionFailure() } effectView.cornerRadius = derivedConfig.windowCornerRadius effectView.tintColor = preferredBackgroundColor - effectView.frame = windowContentView.bounds effectView.autoresizingMask = [.width, .height] From 4e10f27be4fbd1d0c8c2dc84dd9bc3deab339e0c Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 15 Dec 2025 11:00:53 -0800 Subject: [PATCH 9/9] config: macos blur settings enable blur on non-Mac --- src/config/Config.zig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/config/Config.zig b/src/config/Config.zig index 18224a3cd..409e35516 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -933,6 +933,9 @@ palette: Palette = .{}, /// * `macos-glass-regular` - Standard glass effect with some opacity /// * `macos-glass-clear` - Highly transparent glass effect /// +/// If the macOS values are set, then this implies `background-blur = true` +/// on non-macOS platforms. +/// /// Supported on macOS and on some Linux desktop environments, including: /// /// * KDE Plasma (Wayland and X11) @@ -8368,6 +8371,11 @@ pub const BackgroundBlur = union(enum) { .false => false, .true => true, .radius => |v| v > 0, + + // We treat these as true because they both imply some blur! + // This has the effect of making the standard blur happen on + // Linux. + .@"macos-glass-regular", .@"macos-glass-clear" => true, }; }