diff --git a/core/src/window/settings.rs b/core/src/window/settings.rs index 94bcfd78..cbb2d943 100644 --- a/core/src/window/settings.rs +++ b/core/src/window/settings.rs @@ -62,6 +62,18 @@ pub struct Settings { /// Whether the window should be transparent. pub transparent: bool, + /// Whether the window should have blurry background. + /// + /// Note that the blurry effect is applied to the transparent window. You need to enable + /// [`Settings::transparent`] and set a proper opacity value to the background color with + /// `Application::style`. + /// + /// This option is only supported on macOS and Linux. Please read the [winit document][winit] + /// for more details. + /// + /// [winit]: https://docs.rs/winit/latest/winit/window/struct.Window.html#method.set_blur + pub blur: bool, + /// The window [`Level`]. pub level: Level, @@ -95,6 +107,7 @@ impl Default for Settings { resizable: true, decorations: true, transparent: false, + blur: false, level: Level::default(), icon: None, exit_on_close_request: true, diff --git a/winit/src/conversion.rs b/winit/src/conversion.rs index 08d8db94..63780175 100644 --- a/winit/src/conversion.rs +++ b/winit/src/conversion.rs @@ -41,6 +41,7 @@ pub fn window_attributes( }) .with_decorations(settings.decorations) .with_transparent(settings.transparent) + .with_blur(settings.blur) .with_window_icon(settings.icon.and_then(icon)) .with_window_level(window_level(settings.level)) .with_visible(settings.visible);