blur enabled event

This commit is contained in:
Ashley Wulber 2026-04-17 13:41:09 -04:00 committed by Ashley Wulber
parent 1bcba7e30c
commit a63d57261f
3 changed files with 21 additions and 20 deletions

View file

@ -46,4 +46,6 @@ pub enum Event {
Subsurface(SubsurfaceEvent),
/// Keyboard inhibit shortcuts
ShortcutsInhibited(bool),
/// Blur Support Enabled
BlurEnabled,
}

View file

@ -1,6 +1,7 @@
use std::collections::HashMap;
use cctk::sctk;
use iced_futures::futures::SinkExt;
use iced_runtime::core::Rectangle;
use iced_runtime::platform_specific::wayland::Action;
use sctk::globals::GlobalData;
@ -11,7 +12,7 @@ use wayland_protocols::ext::background_effect::v1::client::ext_background_effect
use wayland_protocols::ext::background_effect::v1::client::ext_background_effect_surface_v1::ExtBackgroundEffectSurfaceV1;
use crate::event_loop::state::SctkState;
use crate::window;
use crate::{platform_specific, window};
#[derive(Debug, Clone)]
pub struct ExtBackgroundEffectManager {
@ -70,8 +71,15 @@ impl Dispatch<ExtBackgroundEffectManagerV1, GlobalData, SctkState>
state.ext_background_effect_manager.as_mut()
{
bg_effect_mgr.capabilities = capability;
queued_actions =
bg_effect_mgr.queued_blur_actions.drain().collect();
if capability.contains(Capability::Blur) {
queued_actions = bg_effect_mgr
.queued_blur_actions
.drain()
.collect();
state
.sctk_events
.push(crate::sctk_event::SctkEvent::Blur);
}
}
for (id, rects) in queued_actions {
_ = state.handle_action(Action::BlurSurface(id, rects));

View file

@ -68,10 +68,8 @@ use cctk::{
xdg::{popup::PopupConfigure, window::WindowConfigure},
},
},
wayland_client::protocol::wl_subsurface::WlSubsurface,
};
use std::{
any::Any,
collections::HashMap,
num::NonZeroU32,
sync::{Arc, Mutex},
@ -98,9 +96,7 @@ use super::{
#[derive(Debug, Clone)]
pub enum SctkEvent {
//
// Input events
//
Blur,
SeatEvent {
variant: SeatEventVariant,
id: WlSeat,
@ -122,11 +118,6 @@ pub enum SctkEvent {
seat_id: WlSeat,
surface: WlSurface,
},
// TODO data device & touch
//
// Surface Events
//
WindowEvent {
variant: WindowEventVariant,
id: WlSurface,
@ -167,10 +158,6 @@ pub enum SctkEvent {
},
SubsurfaceEvent(SubsurfaceEventVariant),
//
// output events
//
NewOutput {
id: WlOutput,
info: Option<OutputInfo>,
@ -180,9 +167,7 @@ pub enum SctkEvent {
info: OutputInfo,
},
RemovedOutput(WlOutput),
//
// compositor events
//
ScaleFactorChanged {
factor: f64,
id: WlOutput,
@ -1738,6 +1723,12 @@ impl SctkEvent {
),
),
)),
SctkEvent::Blur => events.push((
None,
iced_runtime::core::Event::PlatformSpecific(
PlatformSpecific::Wayland(wayland::Event::BlurEnabled),
),
)),
}
}
}