Skip to content

Commit b0c02aa

Browse files
committed
feat: layer shell blur
1 parent 78a720d commit b0c02aa

10 files changed

Lines changed: 140 additions & 164 deletions

File tree

Cargo.lock

Lines changed: 46 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cosmic-panel-bin/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ tiny-skia = "0.11"
6767
ron = "0.12"
6868
rand = "0.10"
6969
cosmic-notifications-util = { git = "https://github.com/pop-os/cosmic-notifications", default-features = false }
70+
cosmic-notifications-config = { git = "https://github.com/pop-os/cosmic-notifications", default-features = false }
7071
# cosmic-notifications-util = { path = "../../cosmic-notifications-daemon/cosmic-notifications-util", default-features = false }
7172
wayland-backend = { version = "0.3.14", features = ["client_system"] }
7273
zbus = { version = "5.14", features = ["tokio", "p2p"] }

cosmic-panel-bin/src/notifications.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use anyhow::Result;
2-
use cosmic_notifications_util::PANEL_NOTIFICATIONS_FD;
2+
use cosmic_notifications_config::PANEL_NOTIFICATIONS_FD;
33
use smithay::reexports::rustix::io::{FdFlags, fcntl_getfd, fcntl_setfd};
44
use smithay::reexports::rustix::{self};
55
use std::os::fd::{FromRawFd, RawFd};

cosmic-panel-bin/src/xdg_shell_wrapper/client/handlers/ext_background_effect.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
use std::collections::HashMap;
2-
31
use cctk::{sctk, wayland_client};
4-
use cosmic::iced::Rectangle;
52
use sctk::globals::GlobalData;
63
use sctk::reexports::client::globals::{BindError, GlobalList};
74
use sctk::reexports::client::protocol::wl_surface::WlSurface;

cosmic-panel-bin/src/xdg_shell_wrapper/client/state.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use cctk::toplevel_info::ToplevelInfoState;
1010
use cctk::toplevel_management::ToplevelManagerState;
1111
use cctk::wayland_client::protocol::wl_pointer::WlPointer;
1212
use cctk::workspace::WorkspaceState;
13+
use cosmic_protocols::corner_radius::v1::client::cosmic_corner_radius_layer_v1::CosmicCornerRadiusLayerV1;
1314
use sctk::compositor::CompositorState;
1415
use sctk::data_device_manager::DataDeviceManagerState;
1516
use sctk::data_device_manager::data_device::DataDevice;
@@ -54,6 +55,7 @@ use std::rc::Rc;
5455
use std::time::{Duration, Instant};
5556
use tracing::error;
5657
use wayland_protocols::ext::background_effect::v1::client::ext_background_effect_manager_v1::ExtBackgroundEffectManagerV1;
58+
use wayland_protocols::ext::background_effect::v1::client::ext_background_effect_surface_v1::ExtBackgroundEffectSurfaceV1;
5759
use wayland_protocols::wp::fractional_scale::v1::client::wp_fractional_scale_v1::WpFractionalScaleV1;
5860
use wayland_protocols::wp::viewporter::client::wp_viewport::WpViewport;
5961

@@ -176,6 +178,7 @@ pub struct ClientState {
176178
Option<wl_output::WlOutput>,
177179
String,
178180
)>,
181+
179182
pub(crate) proxied_layer_surfaces: Vec<(
180183
EGLSurface,
181184
OutputDamageTracker,
@@ -185,6 +188,8 @@ pub struct ClientState {
185188
f64,
186189
Option<WpFractionalScaleV1>,
187190
Option<WpViewport>,
191+
Option<CosmicCornerRadiusLayerV1>, // TODO destroy on drop
192+
Option<ExtBackgroundEffectSurfaceV1>, // TODO destroy on drop
188193
)>,
189194
}
190195

cosmic-panel-bin/src/xdg_shell_wrapper/server/handlers/compositor.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use smithay::wayland::compositor::{CompositorHandler, CompositorState, get_role}
1515
use smithay::wayland::shell::wlr_layer::{ExclusiveZone, Layer};
1616
use smithay::wayland::shm::{ShmHandler, ShmState};
1717
use smithay::{delegate_compositor, delegate_shm};
18-
use tracing::{error, info, trace};
18+
use tracing::{error, trace};
1919
use wayland_egl::WlEglSurface;
2020

2121
use crate::xdg_shell_wrapper::client_state::{SurfaceState, WrapperClientCompositorState};
@@ -185,6 +185,8 @@ impl CompositorHandler for GlobalState {
185185
1.0,
186186
scale,
187187
viewport,
188+
None,
189+
None,
188190
));
189191
}
190192
if let Some((
@@ -196,6 +198,7 @@ impl CompositorHandler for GlobalState {
196198
scale,
197199
_,
198200
viewport,
201+
..,
199202
)) = self
200203
.client_state
201204
.proxied_layer_surfaces

0 commit comments

Comments
 (0)