From d9228d78c6a943ffd0119855a168a610e67f28e8 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Fri, 1 Mar 2024 20:41:55 -0500 Subject: [PATCH] refactor: single instance subscription --- iced | 2 +- src/app/cosmic.rs | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/iced b/iced index 982174af..d2dc8273 160000 --- a/iced +++ b/iced @@ -1 +1 @@ -Subproject commit 982174af4c8a8796aacb020a965c611decba2918 +Subproject commit d2dc82733de4d6d009f0ab9499076d9d26cd2805 diff --git a/src/app/cosmic.rs b/src/app/cosmic.rs index e2e497f1..37565986 100644 --- a/src/app/cosmic.rs +++ b/src/app/cosmic.rs @@ -210,12 +210,6 @@ where }) .map(super::Message::Cosmic), window_events.map(super::Message::Cosmic), - #[cfg(feature = "single-instance")] - self.app - .core() - .single_instance - .then(|| super::single_instance_subscription::()) - .unwrap_or_else(Subscription::none), #[cfg(feature = "xdg-portal")] crate::theme::portal::desktop_settings() .map(Message::DesktopSettings) @@ -230,6 +224,11 @@ where ); } + #[cfg(feature = "single-instance")] + if self.app.core().single_instance { + subscriptions.push(super::single_instance_subscription::()); + } + Subscription::batch(subscriptions) }