diff --git a/Cargo.toml b/Cargo.toml index b4209a2d445..678d44d3b87 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,7 +43,7 @@ xdg-portal = ["ashpd"] # XXX Use "a11y"; which is causing a panic currently applet = ["wayland", "tokio", "cosmic-panel-config", "ron"] applet-token = [] -zbus = ["dep:zbus", "serde", "ron"] +single-instance = ["dep:zbus", "serde", "ron"] [dependencies] apply = "0.3.0" diff --git a/src/app/cosmic.rs b/src/app/cosmic.rs index 257e43d218d..f820649f6c2 100644 --- a/src/app/cosmic.rs +++ b/src/app/cosmic.rs @@ -179,7 +179,7 @@ where }) .map(super::Message::Cosmic), window_events.map(super::Message::Cosmic), - #[cfg(feature = "zbus")] + #[cfg(feature = "single-instance")] self.app .core() .single_instance diff --git a/src/app/mod.rs b/src/app/mod.rs index fcfbc7c6b41..6ce284d2ac9 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -49,7 +49,7 @@ use iced::Subscription; use iced::{window, Application as IcedApplication}; pub use message::Message; use url::Url; -#[cfg(feature = "zbus")] +#[cfg(feature = "single-instance")] use { iced_futures::futures::channel::mpsc::{Receiver, Sender}, iced_futures::futures::SinkExt, @@ -122,7 +122,7 @@ pub fn run(settings: Settings, flags: App::Flags) -> iced::Res cosmic::Cosmic::::run(iced) } -#[cfg(feature = "zbus")] +#[cfg(feature = "single-instance")] #[derive(Debug, Clone)] pub struct DbusActivationMessage> { pub activation_token: Option, @@ -142,10 +142,10 @@ pub enum DbusActivationDetails> { args: Args, }, } -#[cfg(feature = "zbus")] +#[cfg(feature = "single-instance")] #[derive(Debug, Default)] pub struct DbusActivation(Option>); -#[cfg(feature = "zbus")] +#[cfg(feature = "single-instance")] impl DbusActivation { #[must_use] pub fn new() -> Self { @@ -159,7 +159,7 @@ impl DbusActivation { } } -#[cfg(feature = "zbus")] +#[cfg(feature = "single-instance")] #[dbus_proxy(interface = "org.freedesktop.DbusActivation")] pub trait DbusActivationInterface { /// Activate the application. @@ -181,7 +181,7 @@ pub trait DbusActivationInterface { ) -> zbus::Result<()>; } -#[cfg(feature = "zbus")] +#[cfg(feature = "single-instance")] #[dbus_interface(interface = "org.freedesktop.DbusActivation")] impl DbusActivation { async fn activate(&mut self, platform_data: HashMap<&str, Value<'_>>) { @@ -258,7 +258,7 @@ impl DbusActivation { } } -#[cfg(feature = "zbus")] +#[cfg(feature = "single-instance")] /// Launch a COSMIC application with the given [`Settings`]. /// If the application is already running, the arguments will be passed to the @@ -349,15 +349,15 @@ where /// Default async executor to use with the app. type Executor: iced_futures::Executor; - #[cfg(feature = "zbus")] + #[cfg(feature = "single-instance")] /// Argument received [`Application::new`]. type Flags: Clone + CosmicFlags; - #[cfg(not(feature = "zbus"))] + #[cfg(not(feature = "single-instance"))] /// Argument received [`Application::new`]. type Flags: Clone; - #[cfg(feature = "zbus")] + #[cfg(feature = "single-instance")] /// Message type specific to our app. type Message: Clone + From< @@ -369,7 +369,7 @@ where + Send + 'static; - #[cfg(not(feature = "zbus"))] + #[cfg(not(feature = "single-instance"))] /// Message type specific to our app. type Message: Clone + std::fmt::Debug + Send + 'static; @@ -626,7 +626,7 @@ impl ApplicationExt for App { } } -#[cfg(feature = "zbus")] +#[cfg(feature = "single-instance")] fn single_instance_subscription() -> Subscription> { use iced_futures::futures::StreamExt;