diff --git a/cosmic-app-list/src/app.rs b/cosmic-app-list/src/app.rs index 3b308b29..9f252a7d 100755 --- a/cosmic-app-list/src/app.rs +++ b/cosmic-app-list/src/app.rs @@ -452,9 +452,11 @@ impl cosmic::Application for CosmicAppList { } } Message::Favorite(id) => { - if let Some(i) = self.active_list.iter().position(|t| { - t.desktop_info.id == id - }) { + if let Some(i) = self + .active_list + .iter() + .position(|t| t.desktop_info.id == id) + { let entry = self.active_list.remove(i); self.favorite_list.push(entry); } @@ -488,9 +490,8 @@ impl cosmic::Application for CosmicAppList { if let Some(p) = self.popup.take() { return destroy_popup(p.0); } - if let (Some(tx), Some(seat)) = (self.toplevel_sender.as_ref(), self.seat.as_ref()) - { - let _ = tx.send(ToplevelRequest::Activate(handle, seat.clone())); + if let Some(tx) = self.toplevel_sender.as_ref() { + let _ = tx.send(ToplevelRequest::Activate(handle)); } } Message::Quit(id) => { diff --git a/cosmic-app-list/src/toplevel_handler.rs b/cosmic-app-list/src/toplevel_handler.rs index 2b1f2f41..76030e9d 100644 --- a/cosmic-app-list/src/toplevel_handler.rs +++ b/cosmic-app-list/src/toplevel_handler.rs @@ -3,8 +3,7 @@ use cctk::{ sctk::{ self, reexports::{ - calloop, - client::{protocol::wl_seat::WlSeat, WaylandSource}, + calloop, calloop_wayland_source::WaylandSource, client::protocol::wl_seat::WlSeat, }, seat::{SeatHandler, SeatState}, }, @@ -132,7 +131,7 @@ pub(crate) fn toplevel_handler( let (globals, event_queue) = registry_queue_init(&conn).unwrap(); let mut event_loop = calloop::EventLoop::::try_new().unwrap(); let qh = event_queue.handle(); - let wayland_source = WaylandSource::new(event_queue).unwrap(); + let wayland_source = WaylandSource::new(conn, event_queue); let handle = event_loop.handle(); wayland_source .insert(handle.clone()) @@ -141,9 +140,11 @@ pub(crate) fn toplevel_handler( if handle .insert_source(rx, |event, _, state| match event { calloop::channel::Event::Msg(req) => match req { - ToplevelRequest::Activate(handle, seat) => { - let manager = &state.toplevel_manager_state.manager; - manager.activate(&handle, &seat); + ToplevelRequest::Activate(handle) => { + if let Some(seat) = state.seat_state.seats().next() { + let manager = &state.toplevel_manager_state.manager; + manager.activate(&handle, &seat); + } } ToplevelRequest::Quit(handle) => { let manager = &state.toplevel_manager_state.manager; diff --git a/cosmic-app-list/src/toplevel_subscription.rs b/cosmic-app-list/src/toplevel_subscription.rs index e52906f2..b285fae6 100644 --- a/cosmic-app-list/src/toplevel_subscription.rs +++ b/cosmic-app-list/src/toplevel_subscription.rs @@ -83,7 +83,7 @@ pub enum ToplevelUpdate { #[derive(Debug, Clone)] pub enum ToplevelRequest { - Activate(ZcosmicToplevelHandleV1, WlSeat), + Activate(ZcosmicToplevelHandleV1), Quit(ZcosmicToplevelHandleV1), Exit, } diff --git a/cosmic-applet-time/src/main.rs b/cosmic-applet-time/src/main.rs index 5e2d2904..57b9dad1 100644 --- a/cosmic-applet-time/src/main.rs +++ b/cosmic-applet-time/src/main.rs @@ -5,6 +5,7 @@ use cosmic::iced::{ window, Alignment, Length, Rectangle, Subscription, }; use cosmic::iced_style::application; +use cosmic::theme; use cosmic::{app, applet::cosmic_panel_config::PanelAnchor, Command}; use cosmic::{ widget::{icon, rectangle_tracker::*}, diff --git a/cosmic-applet-workspaces/src/wayland.rs b/cosmic-applet-workspaces/src/wayland.rs index 330b9de8..1494ea60 100644 --- a/cosmic-applet-workspaces/src/wayland.rs +++ b/cosmic-applet-workspaces/src/wayland.rs @@ -5,6 +5,7 @@ use cctk::{ output::{OutputHandler, OutputState}, reexports::{ calloop, + calloop_wayland_source::WaylandSource, client::{self as wayland_client}, }, registry::{ProvidesRegistryState, RegistryState}, @@ -18,7 +19,7 @@ use wayland_client::backend::ObjectId; use wayland_client::{ globals::registry_queue_init, protocol::wl_output::{self, WlOutput}, - ConnectError, Proxy, WaylandSource, + ConnectError, Proxy, }; use wayland_client::{Connection, QueueHandle, WEnum}; @@ -53,8 +54,7 @@ pub fn spawn_workspaces(tx: mpsc::Sender) -> SyncSender