diff --git a/runtime/src/command/platform_specific/wayland/window.rs b/runtime/src/command/platform_specific/wayland/window.rs index bfb3cc9b64..2b6c10ae15 100644 --- a/runtime/src/command/platform_specific/wayland/window.rs +++ b/runtime/src/command/platform_specific/wayland/window.rs @@ -36,6 +36,9 @@ pub struct SctkWindowSettings { /// Whether the window should be transparent. pub transparent: bool, + + /// xdg-activation token + pub xdg_activation_token: Option, } impl Default for SctkWindowSettings { @@ -55,6 +58,7 @@ impl Default for SctkWindowSettings { resizable: Some(8.0), client_decorations: true, transparent: false, + xdg_activation_token: Default::default(), } } } diff --git a/sctk/src/event_loop/state.rs b/sctk/src/event_loop/state.rs index a39d284fac..09ee473b4d 100644 --- a/sctk/src/event_loop/state.rs +++ b/sctk/src/event_loop/state.rs @@ -617,6 +617,7 @@ where size_limits, resizable, + xdg_activation_token, .. } = settings; // TODO Ashley: set window as opaque if transparency is false @@ -681,6 +682,12 @@ where window.commit(); + if let (Some(token), Some(activation_state)) = + (xdg_activation_token, self.activation_state.as_ref()) + { + activation_state.activate::<()>(window.wl_surface(), token); + } + let wp_viewport = self.viewporter_state.as_ref().map(|state| { state.get_viewport(window.wl_surface(), &self.queue_handle) });