diff --git a/src/app.rs b/src/app.rs index e9fe8cc..b0931a8 100644 --- a/src/app.rs +++ b/src/app.rs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: GPL-3.0-only use cosmic::app::{self, Core, Task, context_drawer}; +use cosmic::core::Auto; use cosmic::cosmic_config::{self, ConfigSet}; use cosmic::iced::clipboard::dnd::DndAction; use cosmic::iced::core::SmolStr; @@ -27,7 +28,7 @@ use cosmic::iced::{ IcedMargin, IcedOutput, SctkLayerSurfaceSettings, }, platform_specific::shell::wayland::commands::layer_surface::{ - Anchor, KeyboardInteractivity, Layer, destroy_layer_surface, get_layer_surface, + Anchor, KeyboardInteractivity, Layer, destroy_layer_surface, }, }; use cosmic::widget::about::About; @@ -2405,6 +2406,9 @@ impl Application for App { ), ]); + if matches!(flags.mode, Mode::Desktop) { + core.set_auto_blur(Auto::Window | Auto::Popup); + } let mut app = Self { core, about, @@ -4495,6 +4499,7 @@ impl Application for App { commands.push(self.update(Message::CheckClipboard)); commands.push(self.update(Message::Surface( cosmic::surface::action::app_popup( + |_| Default::default(), move |app: &mut Self| -> SctkPopupSettings { let anchor_rect = Rectangle { x: point.x as i32, @@ -5264,24 +5269,37 @@ impl Application for App { .insert(surface_id, Window::new(WindowKind::Desktop(entity))); return Task::batch([ command, - get_layer_surface(SctkLayerSurfaceSettings { - id: surface_id, - layer: Layer::Bottom, - keyboard_interactivity: KeyboardInteractivity::OnDemand, - input_zone: None, - anchor: Anchor::TOP | Anchor::BOTTOM | Anchor::LEFT | Anchor::RIGHT, - output: IcedOutput::Output(output), - namespace: "cosmic-files-applet".into(), - size: Some((None, None)), - margin: IcedMargin { - top: 0, - bottom: 0, - left: 0, - right: 0, - }, - exclusive_zone: 0, - size_limits: Limits::NONE.min_width(1.0).min_height(1.0), - }), + cosmic::task::message(cosmic::action::cosmic( + cosmic::app::Action::Surface( + cosmic::surface::action::app_layer_shell( + |_| Default::default(), + move |_: &mut App| SctkLayerSurfaceSettings { + id: surface_id, + layer: Layer::Bottom, + keyboard_interactivity: KeyboardInteractivity::OnDemand, + input_zone: None, + anchor: Anchor::TOP + | Anchor::BOTTOM + | Anchor::LEFT + | Anchor::RIGHT, + output: IcedOutput::Output(output.clone()), + namespace: "cosmic-files-applet".into(), + size: Some((None, None)), + margin: IcedMargin { + top: 0, + bottom: 0, + left: 0, + right: 0, + }, + exclusive_zone: 0, + size_limits: Limits::NONE + .min_width(1.0) + .min_height(1.0), + }, + None, + ), + ), + )), #[cfg(all(feature = "wayland", feature = "desktop-applet"))] overlap_notify(surface_id, true), ]); diff --git a/src/dialog.rs b/src/dialog.rs index 0623da0..54565b4 100644 --- a/src/dialog.rs +++ b/src/dialog.rs @@ -1795,6 +1795,7 @@ impl Application for App { let autosize_id = widget::Id::unique(); commands.push(self.update(Message::Surface( cosmic::surface::action::app_popup( + |_| Default::default(), move |app: &mut Self| -> SctkPopupSettings { let anchor_rect = Rectangle { x: point.x as i32, diff --git a/src/menu.rs b/src/menu.rs index 28ec34e..a441b05 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -436,7 +436,7 @@ pub fn context_menu<'a>( } } - container(column::with_children(children)) + container(cosmic::widget::menu::menu_column::MenuColumn::with_children(children)) .padding(1) //TODO: move style to libcosmic .style(|theme| {