fix: no blur for desktop mode
fix: desktop blur chore: update libcosmic chore: update libcosmic chore: update libcosmic
This commit is contained in:
parent
674a33e3de
commit
0e761ba811
3 changed files with 39 additions and 20 deletions
56
src/app.rs
56
src/app.rs
|
|
@ -2,6 +2,7 @@
|
||||||
// SPDX-License-Identifier: GPL-3.0-only
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
|
||||||
use cosmic::app::{self, Core, Task, context_drawer};
|
use cosmic::app::{self, Core, Task, context_drawer};
|
||||||
|
use cosmic::core::Auto;
|
||||||
use cosmic::cosmic_config::{self, ConfigSet};
|
use cosmic::cosmic_config::{self, ConfigSet};
|
||||||
use cosmic::iced::clipboard::dnd::DndAction;
|
use cosmic::iced::clipboard::dnd::DndAction;
|
||||||
use cosmic::iced::core::SmolStr;
|
use cosmic::iced::core::SmolStr;
|
||||||
|
|
@ -27,7 +28,7 @@ use cosmic::iced::{
|
||||||
IcedMargin, IcedOutput, SctkLayerSurfaceSettings,
|
IcedMargin, IcedOutput, SctkLayerSurfaceSettings,
|
||||||
},
|
},
|
||||||
platform_specific::shell::wayland::commands::layer_surface::{
|
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;
|
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 {
|
let mut app = Self {
|
||||||
core,
|
core,
|
||||||
about,
|
about,
|
||||||
|
|
@ -4495,6 +4499,7 @@ impl Application for App {
|
||||||
commands.push(self.update(Message::CheckClipboard));
|
commands.push(self.update(Message::CheckClipboard));
|
||||||
commands.push(self.update(Message::Surface(
|
commands.push(self.update(Message::Surface(
|
||||||
cosmic::surface::action::app_popup(
|
cosmic::surface::action::app_popup(
|
||||||
|
|_| Default::default(),
|
||||||
move |app: &mut Self| -> SctkPopupSettings {
|
move |app: &mut Self| -> SctkPopupSettings {
|
||||||
let anchor_rect = Rectangle {
|
let anchor_rect = Rectangle {
|
||||||
x: point.x as i32,
|
x: point.x as i32,
|
||||||
|
|
@ -5264,24 +5269,37 @@ impl Application for App {
|
||||||
.insert(surface_id, Window::new(WindowKind::Desktop(entity)));
|
.insert(surface_id, Window::new(WindowKind::Desktop(entity)));
|
||||||
return Task::batch([
|
return Task::batch([
|
||||||
command,
|
command,
|
||||||
get_layer_surface(SctkLayerSurfaceSettings {
|
cosmic::task::message(cosmic::action::cosmic(
|
||||||
id: surface_id,
|
cosmic::app::Action::Surface(
|
||||||
layer: Layer::Bottom,
|
cosmic::surface::action::app_layer_shell(
|
||||||
keyboard_interactivity: KeyboardInteractivity::OnDemand,
|
|_| Default::default(),
|
||||||
input_zone: None,
|
move |_: &mut App| SctkLayerSurfaceSettings {
|
||||||
anchor: Anchor::TOP | Anchor::BOTTOM | Anchor::LEFT | Anchor::RIGHT,
|
id: surface_id,
|
||||||
output: IcedOutput::Output(output),
|
layer: Layer::Bottom,
|
||||||
namespace: "cosmic-files-applet".into(),
|
keyboard_interactivity: KeyboardInteractivity::OnDemand,
|
||||||
size: Some((None, None)),
|
input_zone: None,
|
||||||
margin: IcedMargin {
|
anchor: Anchor::TOP
|
||||||
top: 0,
|
| Anchor::BOTTOM
|
||||||
bottom: 0,
|
| Anchor::LEFT
|
||||||
left: 0,
|
| Anchor::RIGHT,
|
||||||
right: 0,
|
output: IcedOutput::Output(output.clone()),
|
||||||
},
|
namespace: "cosmic-files-applet".into(),
|
||||||
exclusive_zone: 0,
|
size: Some((None, None)),
|
||||||
size_limits: Limits::NONE.min_width(1.0).min_height(1.0),
|
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"))]
|
#[cfg(all(feature = "wayland", feature = "desktop-applet"))]
|
||||||
overlap_notify(surface_id, true),
|
overlap_notify(surface_id, true),
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
|
|
@ -1795,6 +1795,7 @@ impl Application for App {
|
||||||
let autosize_id = widget::Id::unique();
|
let autosize_id = widget::Id::unique();
|
||||||
commands.push(self.update(Message::Surface(
|
commands.push(self.update(Message::Surface(
|
||||||
cosmic::surface::action::app_popup(
|
cosmic::surface::action::app_popup(
|
||||||
|
|_| Default::default(),
|
||||||
move |app: &mut Self| -> SctkPopupSettings {
|
move |app: &mut Self| -> SctkPopupSettings {
|
||||||
let anchor_rect = Rectangle {
|
let anchor_rect = Rectangle {
|
||||||
x: point.x as i32,
|
x: point.x as i32,
|
||||||
|
|
|
||||||
|
|
@ -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)
|
.padding(1)
|
||||||
//TODO: move style to libcosmic
|
//TODO: move style to libcosmic
|
||||||
.style(|theme| {
|
.style(|theme| {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue