chore: blur updates
This commit is contained in:
parent
bb5c7e12a4
commit
0b0d2925ff
4 changed files with 828 additions and 719 deletions
1456
Cargo.lock
generated
1456
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -160,8 +160,8 @@ default-features = false
|
|||
features = ["advanced-shaping"]
|
||||
|
||||
[patch."https://github.com/pop-os/cosmic-protocols"]
|
||||
cctk = { git = "https://github.com/pop-os/cosmic-protocols//", package = "cosmic-client-toolkit", rev = "32283d7" }
|
||||
cosmic-protocols = { git = "https://github.com/pop-os/cosmic-protocols//", rev = "32283d7" }
|
||||
cctk = { git = "https://github.com/pop-os/cosmic-protocols//", package = "cosmic-client-toolkit", rev = "c0cff4d" }
|
||||
cosmic-protocols = { git = "https://github.com/pop-os/cosmic-protocols//", rev = "c0cff4d" }
|
||||
|
||||
# [patch."https://github.com/pop-os/libcosmic"]
|
||||
# iced_core = { git = "https://github.com/pop-os/libcosmic//", branch = "theme-v2" }
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use cosmic::iced::platform_specific::runtime::wayland::layer_surface::{
|
|||
IcedMargin, IcedOutput, SctkLayerSurfaceSettings,
|
||||
};
|
||||
use cosmic::iced::platform_specific::shell::wayland::commands::layer_surface::{
|
||||
Anchor, KeyboardInteractivity, Layer, destroy_layer_surface, get_layer_surface,
|
||||
Anchor, KeyboardInteractivity, Layer, destroy_layer_surface,
|
||||
};
|
||||
use cosmic::iced::platform_specific::shell::wayland::commands::subsurface::reposition_subsurface;
|
||||
use cosmic::iced::runtime::core::window::Id as SurfaceId;
|
||||
|
|
@ -26,6 +26,7 @@ use cosmic::iced::runtime::platform_specific::wayland::subsurface::SctkSubsurfac
|
|||
use cosmic::iced::{
|
||||
self, Alignment, Background, Border, Length, Point, Rectangle, Size, Subscription, window,
|
||||
};
|
||||
use cosmic::surface::action::{LiveSettings, app_layer_shell};
|
||||
use cosmic::widget::{id_container, text};
|
||||
use cosmic::{Element, executor, surface, theme, widget};
|
||||
use cosmic_greeter_config::Config as CosmicGreeterConfig;
|
||||
|
|
@ -1291,24 +1292,40 @@ impl cosmic::Application for App {
|
|||
);
|
||||
return Task::batch([
|
||||
self.update_user_data(),
|
||||
get_layer_surface(SctkLayerSurfaceSettings {
|
||||
id: surface_id,
|
||||
layer: Layer::Overlay,
|
||||
keyboard_interactivity: KeyboardInteractivity::Exclusive,
|
||||
input_zone: None,
|
||||
anchor: Anchor::TOP | Anchor::LEFT | Anchor::BOTTOM | Anchor::RIGHT,
|
||||
output: IcedOutput::Output(output),
|
||||
namespace: "cosmic-locker".into(),
|
||||
size: Some((None, None)),
|
||||
margin: IcedMargin {
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
cosmic::surface::surface_task(app_layer_shell(
|
||||
|_: &App| LiveSettings {
|
||||
padding: None,
|
||||
corners: None,
|
||||
blur: Some(false),
|
||||
},
|
||||
exclusive_zone: -1,
|
||||
size_limits: iced::Limits::NONE.min_width(1.0).min_height(1.0),
|
||||
}),
|
||||
move |_: &mut App| {
|
||||
let output = output.clone();
|
||||
SctkLayerSurfaceSettings {
|
||||
id: surface_id,
|
||||
layer: Layer::Overlay,
|
||||
keyboard_interactivity: KeyboardInteractivity::Exclusive,
|
||||
input_zone: None,
|
||||
anchor: Anchor::TOP
|
||||
| Anchor::LEFT
|
||||
| Anchor::BOTTOM
|
||||
| Anchor::RIGHT,
|
||||
output: IcedOutput::Output(output),
|
||||
namespace: "cosmic-locker".into(),
|
||||
size: Some((None, None)),
|
||||
margin: IcedMargin {
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
},
|
||||
exclusive_zone: -1,
|
||||
size_limits: iced::Limits::NONE
|
||||
.min_width(1.0)
|
||||
.min_height(1.0),
|
||||
}
|
||||
},
|
||||
None,
|
||||
)),
|
||||
cosmic::task::message(cosmic::Action::Surface(msg)),
|
||||
]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,13 +7,14 @@ use cosmic::cctk::wayland_protocols::xdg::shell::client::xdg_positioner::Gravity
|
|||
use cosmic::iced::event::wayland::{OutputEvent, SessionLockEvent};
|
||||
use cosmic::iced::futures::{self, SinkExt};
|
||||
use cosmic::iced::platform_specific::shell::wayland::commands::session_lock::{
|
||||
destroy_lock_surface, get_lock_surface, lock, unlock,
|
||||
destroy_lock_surface, lock, unlock,
|
||||
};
|
||||
use cosmic::iced::runtime::core::window::Id as SurfaceId;
|
||||
use cosmic::iced::runtime::platform_specific::wayland::subsurface::SctkSubsurfaceSettings;
|
||||
use cosmic::iced::{
|
||||
self, Alignment, Background, Border, Length, Point, Rectangle, Size, Subscription,
|
||||
};
|
||||
use cosmic::surface::action::LiveSettings;
|
||||
use cosmic::{Element, executor, surface, theme, widget};
|
||||
use cosmic_config::CosmicConfigEntry;
|
||||
use cosmic_greeter_daemon::{TimeAppletConfig, UserData};
|
||||
|
|
@ -663,7 +664,7 @@ impl cosmic::Application for App {
|
|||
/// Creates the application, and optionally emits command on initialize.
|
||||
fn init(mut core: Core, flags: Self::Flags) -> (Self, Task<Self::Message>) {
|
||||
core.set_app_type(cosmic::core::AppType::System);
|
||||
core.set_auto_blur(enumflags2::BitFlags::empty());
|
||||
|
||||
let (mut common, common_task) = Common::init(core);
|
||||
common.on_output_event = Some(Box::new(|output_event, output| {
|
||||
Message::OutputEvent(output_event, output)
|
||||
|
|
@ -820,9 +821,19 @@ impl cosmic::Application for App {
|
|||
);
|
||||
|
||||
if matches!(self.state, State::Locked { .. }) {
|
||||
return get_lock_surface(surface_id, output).chain({
|
||||
cosmic::task::message(cosmic::Action::Surface(msg))
|
||||
});
|
||||
return cosmic::task::message(cosmic::Action::Surface(
|
||||
cosmic::surface::action::lock(
|
||||
|| LiveSettings {
|
||||
padding: None,
|
||||
corners: None,
|
||||
blur: Some(false),
|
||||
},
|
||||
surface_id,
|
||||
output,
|
||||
None::<fn() -> cosmic::Element<'static, cosmic::Action<Message>>>,
|
||||
),
|
||||
))
|
||||
.chain(cosmic::task::message(cosmic::Action::Surface(msg)));
|
||||
}
|
||||
}
|
||||
OutputEvent::Removed => {
|
||||
|
|
@ -962,7 +973,18 @@ impl cosmic::Application for App {
|
|||
|
||||
// Create lock surfaces
|
||||
for (output, surface_id) in self.common.surface_ids.iter() {
|
||||
commands.push(get_lock_surface(*surface_id, output.clone()));
|
||||
commands.push(cosmic::task::message(cosmic::Action::Surface(
|
||||
cosmic::surface::action::lock(
|
||||
|| LiveSettings {
|
||||
padding: None,
|
||||
corners: None,
|
||||
blur: Some(false),
|
||||
},
|
||||
*surface_id,
|
||||
output.clone(),
|
||||
None::<fn() -> cosmic::Element<'static, cosmic::Action<Message>>>,
|
||||
),
|
||||
)));
|
||||
|
||||
if let Some((rect, name)) = self
|
||||
.common
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue