diff --git a/runtime/src/window.rs b/runtime/src/window.rs index 8552a7b1..ba96a04e 100644 --- a/runtime/src/window.rs +++ b/runtime/src/window.rs @@ -188,6 +188,8 @@ pub enum Action { /// Recompute the layouts of all the windows. RelayoutAll, + /// Set window blur. + SetBlur(bool), } /// A window managed by iced. @@ -537,3 +539,10 @@ pub fn allow_automatic_tabbing(enabled: bool) -> Task { enabled, ))) } + +/// Sets the blur effect for the window. +/// +/// This is only supported on platforms that support window blur. +pub fn set_blur(enable: bool) -> Task { + task::effect(crate::Action::Window(Action::SetBlur(enable))) +} diff --git a/winit/src/lib.rs b/winit/src/lib.rs index 968a810a..f558189f 100644 --- a/winit/src/lib.rs +++ b/winit/src/lib.rs @@ -1960,6 +1960,11 @@ fn run_action<'a, P, C>( window.raw.request_redraw(); } } + window::Action::SetBlur(enable) => { + for (_, window) in window_manager.iter_mut() { + window.raw.set_blur(enable); + } + } }, Action::System(action) => match action { system::Action::GetInformation(_channel) => {