From 619550cf619a64d592df810bd30e2a9f01a1937d Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Mon, 17 Mar 2025 22:18:25 -0400 Subject: [PATCH] fix: handling of surface action --- cosmic-applet-battery/src/app.rs | 6 +++++- cosmic-applet-bluetooth/src/app.rs | 6 +++++- cosmic-applet-input-sources/src/lib.rs | 6 +++++- cosmic-applet-minimize/src/lib.rs | 6 +++++- cosmic-applet-network/src/app.rs | 6 +++++- cosmic-applet-notifications/src/lib.rs | 6 +++++- cosmic-applet-tiling/src/window.rs | 6 +++++- cosmic-applet-time/src/window.rs | 6 +++++- cosmic-applet-workspaces/src/components/app.rs | 6 +++++- 9 files changed, 45 insertions(+), 9 deletions(-) diff --git a/cosmic-applet-battery/src/app.rs b/cosmic-applet-battery/src/app.rs index 835520c3..2708607c 100644 --- a/cosmic-applet-battery/src/app.rs +++ b/cosmic-applet-battery/src/app.rs @@ -454,7 +454,11 @@ impl cosmic::Application for CosmicBatteryApplet { } } }, - Message::Surface(surface_message) => unreachable!(), + Message::Surface(a) => { + return cosmic::task::message(cosmic::Action::Cosmic( + cosmic::app::Action::Surface(a), + )); + } } Task::none() } diff --git a/cosmic-applet-bluetooth/src/app.rs b/cosmic-applet-bluetooth/src/app.rs index dee5a07d..627f3809 100644 --- a/cosmic-applet-bluetooth/src/app.rs +++ b/cosmic-applet-bluetooth/src/app.rs @@ -324,7 +324,11 @@ impl cosmic::Application for CosmicBluetoothApplet { }); } } - Message::Surface(surface_message) => unreachable!(), + Message::Surface(a) => { + return cosmic::task::message(cosmic::Action::Cosmic( + cosmic::app::Action::Surface(a), + )); + } } self.update_icon(); Task::none() diff --git a/cosmic-applet-input-sources/src/lib.rs b/cosmic-applet-input-sources/src/lib.rs index 9d47a422..0abc595b 100644 --- a/cosmic-applet-input-sources/src/lib.rs +++ b/cosmic-applet-input-sources/src/lib.rs @@ -189,7 +189,11 @@ impl cosmic::Application for Window { } } } - Message::Surface(surface_message) => unreachable!(), + Message::Surface(a) => { + return cosmic::task::message(cosmic::Action::Cosmic( + cosmic::app::Action::Surface(a), + )); + } } Task::none() diff --git a/cosmic-applet-minimize/src/lib.rs b/cosmic-applet-minimize/src/lib.rs index d9f733ef..b5a350a6 100644 --- a/cosmic-applet-minimize/src/lib.rs +++ b/cosmic-applet-minimize/src/lib.rs @@ -212,7 +212,11 @@ impl cosmic::Application for Minimize { } } Message::CloseOverflowPopup => todo!(), - Message::Surface(surface_message) => unreachable!(), + Message::Surface(a) => { + return cosmic::task::message(cosmic::Action::Cosmic( + cosmic::app::Action::Surface(a), + )); + } }; Task::none() } diff --git a/cosmic-applet-network/src/app.rs b/cosmic-applet-network/src/app.rs index 8a4670fb..a67b6195 100644 --- a/cosmic-applet-network/src/app.rs +++ b/cosmic-applet-network/src/app.rs @@ -565,7 +565,11 @@ impl cosmic::Application for CosmicNetworkApplet { return self.update(Message::SelectWirelessAccessPoint(ap)); } } - Message::Surface(surface_message) => unreachable!(), + Message::Surface(a) => { + return cosmic::task::message(cosmic::Action::Cosmic( + cosmic::app::Action::Surface(a), + )); + } } Task::none() } diff --git a/cosmic-applet-notifications/src/lib.rs b/cosmic-applet-notifications/src/lib.rs index 7834e955..c9eddff7 100644 --- a/cosmic-applet-notifications/src/lib.rs +++ b/cosmic-applet-notifications/src/lib.rs @@ -388,7 +388,11 @@ impl cosmic::Application for Notifications { }); } } - Message::Surface(surface_message) => unreachable!(), + Message::Surface(a) => { + return cosmic::task::message(cosmic::Action::Cosmic( + cosmic::app::Action::Surface(a), + )); + } }; self.update_icon(); Task::none() diff --git a/cosmic-applet-tiling/src/window.rs b/cosmic-applet-tiling/src/window.rs index ff34b6bf..422c57f5 100644 --- a/cosmic-applet-tiling/src/window.rs +++ b/cosmic-applet-tiling/src/window.rs @@ -268,7 +268,11 @@ impl cosmic::Application for Window { cmd.arg("window-management"); tokio::spawn(cosmic::process::spawn(cmd)); } - Message::Surface(surface_message) => unreachable!(), + Message::Surface(a) => { + return cosmic::task::message(cosmic::Action::Cosmic( + cosmic::app::Action::Surface(a), + )); + } } Task::none() } diff --git a/cosmic-applet-time/src/window.rs b/cosmic-applet-time/src/window.rs index 512e345d..c41eea70 100644 --- a/cosmic-applet-time/src/window.rs +++ b/cosmic-applet-time/src/window.rs @@ -437,7 +437,11 @@ impl cosmic::Application for Window { self.update(Message::Tick) } - Message::Surface(surface_message) => unreachable!(), + Message::Surface(a) => { + return cosmic::task::message(cosmic::Action::Cosmic( + cosmic::app::Action::Surface(a), + )); + } } } diff --git a/cosmic-applet-workspaces/src/components/app.rs b/cosmic-applet-workspaces/src/components/app.rs index 38d0503a..dcf15f1b 100644 --- a/cosmic-applet-workspaces/src/components/app.rs +++ b/cosmic-applet-workspaces/src/components/app.rs @@ -209,7 +209,11 @@ impl cosmic::Application for IcedWorkspacesApplet { Message::WorkspaceOverview => { let _ = ShellCommand::new("cosmic-workspaces").spawn(); } - Message::Surface(surface_message) => unreachable!(), + Message::Surface(a) => { + return cosmic::task::message(cosmic::Action::Cosmic( + cosmic::app::Action::Surface(a), + )); + } } Task::none() }