diff options
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | Cargo.lock | 4 | ||||
-rw-r--r-- | alacritty/Cargo.toml | 2 | ||||
-rw-r--r-- | alacritty/src/config/window.rs | 16 | ||||
-rw-r--r-- | alacritty/src/display/window.rs | 5 | ||||
-rw-r--r-- | alacritty/src/window_context.rs | 3 | ||||
-rw-r--r-- | extra/man/alacritty.5.scd | 6 |
7 files changed, 27 insertions, 10 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fbf97fc..80abac43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Support startup notify protocol to raise initial window on Wayland/X11 - Debug option `prefer_egl` to prioritize EGL over other display APIs - Inline vi-mode search using `f`/`F`/`t`/`T` +- `window.blur` config option to request blur for transparent windows ### Changed @@ -2386,9 +2386,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winit" -version = "0.29.2" +version = "0.29.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b829f75d02fe1e225b97c91a04c326900147a50234d1141a1cbe215ce8798c11" +checksum = "161598019a9da35ab6c34dc46cd13546cba9dbf9816475d4dd9a639455016563" dependencies = [ "ahash", "android-activity", diff --git a/alacritty/Cargo.toml b/alacritty/Cargo.toml index 0752b2d2..890b5226 100644 --- a/alacritty/Cargo.toml +++ b/alacritty/Cargo.toml @@ -41,7 +41,7 @@ serde_json = "1" serde_yaml = "0.9.25" toml = "0.8.2" unicode-width = "0.1" -winit = { version = "0.29.2", default-features = false, features = ["rwh_05", "serde"] } +winit = { version = "0.29.3", default-features = false, features = ["rwh_05", "serde"] } [build-dependencies] gl_generator = "0.14.0" diff --git a/alacritty/src/config/window.rs b/alacritty/src/config/window.rs index 9d40b5ad..bb7c4080 100644 --- a/alacritty/src/config/window.rs +++ b/alacritty/src/config/window.rs @@ -48,6 +48,9 @@ pub struct WindowConfig { /// Background opacity from 0.0 to 1.0. pub opacity: Percentage, + /// Request blur behind the window. + pub blur: bool, + /// Controls which `Option` key should be treated as `Alt`. #[cfg(target_os = "macos")] option_as_alt: OptionAsAlt, @@ -66,17 +69,18 @@ impl Default for WindowConfig { fn default() -> Self { Self { dynamic_title: true, + blur: Default::default(), + embed: Default::default(), + padding: Default::default(), + opacity: Default::default(), position: Default::default(), + identity: Default::default(), + dimensions: Default::default(), decorations: Default::default(), startup_mode: Default::default(), - embed: Default::default(), - decorations_theme_variant: Default::default(), dynamic_padding: Default::default(), - identity: Identity::default(), - opacity: Default::default(), - padding: Default::default(), - dimensions: Default::default(), resize_increments: Default::default(), + decorations_theme_variant: Default::default(), #[cfg(target_os = "macos")] option_as_alt: Default::default(), } diff --git a/alacritty/src/display/window.rs b/alacritty/src/display/window.rs index 5606ca4f..f5128e75 100644 --- a/alacritty/src/display/window.rs +++ b/alacritty/src/display/window.rs @@ -167,6 +167,7 @@ impl Window { .with_theme(config.window.decorations_theme_variant) .with_visible(false) .with_transparent(true) + .with_blur(config.window.blur) .with_maximized(config.window.maximized()) .with_fullscreen(config.window.fullscreen()) .build(event_loop)?; @@ -343,6 +344,10 @@ impl Window { self.window.set_transparent(transparent); } + pub fn set_blur(&self, blur: bool) { + self.window.set_blur(blur); + } + pub fn set_maximized(&self, maximized: bool) { self.window.set_maximized(maximized); } diff --git a/alacritty/src/window_context.rs b/alacritty/src/window_context.rs index 5c017cab..a80aecca 100644 --- a/alacritty/src/window_context.rs +++ b/alacritty/src/window_context.rs @@ -345,8 +345,9 @@ impl WindowContext { #[cfg(target_os = "macos")] self.display.window.set_option_as_alt(self.config.window.option_as_alt()); - // Change opacity state. + // Change opacity and blur state. self.display.window.set_transparent(!opaque); + self.display.window.set_blur(self.config.window.blur); // Update hint keys. self.display.hint_state.update_alphabet(self.config.hints.alphabet()); diff --git a/extra/man/alacritty.5.scd b/extra/man/alacritty.5.scd index 57225452..0d4c28cf 100644 --- a/extra/man/alacritty.5.scd +++ b/extra/man/alacritty.5.scd @@ -133,6 +133,12 @@ This section documents the *[window]* table of the configuration file. Default: _1.0_ +*blur* <boolean> _(works on macOS/KDE Wayland)_ + + Request compositor to blur content behind transparent windows. + + Default: _false_ + *startup_mode* "Windowed" | "Maximized" | "Fullscreen" | "SimpleFullscreen" Startup mode (changes require restart) |