From 9520f4fee1bd7b92ca1cb5fc3886520562465069 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Fri, 22 Nov 2024 14:53:24 -0500 Subject: [PATCH 1/8] refactor: avoid changing exclusive zone when hiding --- cosmic-panel-bin/src/space/layout.rs | 37 +++++++---- cosmic-panel-bin/src/space/panel_space.rs | 79 ++++++++--------------- cosmic-panel-bin/src/space/render.rs | 22 +++++-- 3 files changed, 67 insertions(+), 71 deletions(-) diff --git a/cosmic-panel-bin/src/space/layout.rs b/cosmic-panel-bin/src/space/layout.rs index 7b91fb4..afd82c7 100644 --- a/cosmic-panel-bin/src/space/layout.rs +++ b/cosmic-panel-bin/src/space/layout.rs @@ -1,4 +1,5 @@ use std::{ + i32, slice::IterMut, sync::{atomic::AtomicBool, Arc, MutexGuard}, time::{Duration, Instant}, @@ -676,12 +677,8 @@ impl PanelSpace { border_color: [0.0, 0.0, 0.0, 0.0], }; - input_region.subtract( - 0, - 0, - self.dimensions.w.max(new_dim.w), - self.dimensions.h.max(new_dim.h), - ); + input_region.subtract(i32::MIN / 2, i32::MIN / 2, i32::MAX, i32::MAX); + let anim_gap = self.anchor_gap; if is_dock { let (layer_length, actual_length) = if self.config.is_horizontal() { @@ -694,29 +691,41 @@ impl PanelSpace { let (loc, size) = match self.config.anchor { PanelAnchor::Left => ( (-1, side as i32), - (new_logical_crosswise_dim + self.gap() as i32 + 1, container_length), + ( + new_logical_crosswise_dim + self.gap() as i32 + 1 + anim_gap, + container_length, + ), ), PanelAnchor::Right => ( (0, side as i32), - (new_logical_crosswise_dim + self.gap() as i32 + 1, container_length), + ( + new_logical_crosswise_dim + self.gap() as i32 + 1 - anim_gap, + container_length, + ), ), PanelAnchor::Top => ( (side as i32, -1), - (container_length, new_logical_crosswise_dim + self.gap() as i32 + 1), + ( + container_length, + new_logical_crosswise_dim + self.gap() as i32 + 1 + anim_gap, + ), ), PanelAnchor::Bottom => ( (side as i32, 0), - (container_length, new_logical_crosswise_dim + self.gap() as i32 + 1), + ( + container_length, + new_logical_crosswise_dim + self.gap() as i32 + 1 - -anim_gap, + ), ), }; input_region.add(loc.0, loc.1, size.0, size.1); } else { let (loc, size) = match self.config.anchor { - PanelAnchor::Left => ((-1, 0), (new_dim.w + 1, new_dim.h)), - PanelAnchor::Right => ((0, 0), (new_dim.w + 1, new_dim.h)), - PanelAnchor::Top => ((0, -1), (new_dim.w, new_dim.h + 1)), - PanelAnchor::Bottom => ((0, 0), (new_dim.w, new_dim.h + 1)), + PanelAnchor::Left => ((-1, 0), (new_dim.w + 1 + anim_gap, new_dim.h)), + PanelAnchor::Right => ((0, 0), (new_dim.w + 1 - anim_gap, new_dim.h)), + PanelAnchor::Top => ((0, -1), (new_dim.w, new_dim.h + 1 + anim_gap)), + PanelAnchor::Bottom => ((0, 0), (new_dim.w, new_dim.h + 1 - anim_gap)), }; input_region.add(loc.0, loc.1, size.0, size.1); diff --git a/cosmic-panel-bin/src/space/panel_space.rs b/cosmic-panel-bin/src/space/panel_space.rs index 7e4302a..dc0aeec 100644 --- a/cosmic-panel-bin/src/space/panel_space.rs +++ b/cosmic-panel-bin/src/space/panel_space.rs @@ -293,7 +293,10 @@ pub struct PanelSpace { pub minimize_applet_rect: Rectangle, pub panel_rect_settings: RoundedRectangleSettings, pub scale_change_retries: u32, + /// Extra gap for stacked panels. Logical coordinate space. pub additional_gap: i32, + /// Target gap for the panel on its anchored edge. Logical coordinate space. + pub anchor_gap: i32, pub loop_handle: calloop::LoopHandle<'static, GlobalState>, pub left_overflow_button_id: id::Id, pub center_overflow_button_id: id::Id, @@ -380,6 +383,7 @@ impl PanelSpace { remap_attempts: 0, background_element: None, last_minimize_update: Instant::now() - Duration::from_secs(1), + anchor_gap: 0, } } @@ -507,6 +511,7 @@ impl PanelSpace { Some(d) => d, None => return, }; + self.is_dirty = true; if duration_since_last_focus > self.config.get_hide_wait().unwrap() { self.visibility = Visibility::TransitionToHidden { last_instant: Instant::now(), @@ -549,20 +554,13 @@ impl PanelSpace { let target = -panel_size + handle; let cur_pix = (progress_norm * target as f32) as i32; - let margin = self.config.get_margin() as i32; if progress > total_t { if self.config.exclusive_zone() { layer_surface.set_exclusive_zone(panel_size); } - Self::set_margin( - self.config.anchor, - margin, - target, - self.additional_gap, - layer_surface, - ); - layer_shell_wl_surface.commit(); + + self.anchor_gap = target; self.additional_gap = 0; self.visibility = Visibility::Hidden; } else { @@ -570,14 +568,8 @@ impl PanelSpace { if self.config.exclusive_zone() { layer_surface.set_exclusive_zone(panel_size - cur_pix); } - Self::set_margin( - self.config.anchor, - margin, - cur_pix, - self.additional_gap, - layer_surface, - ); - layer_shell_wl_surface.commit(); + + self.anchor_gap = cur_pix; } self.close_popups(|_| false); self.visibility = Visibility::TransitionToHidden { @@ -603,6 +595,7 @@ impl PanelSpace { let progress_norm = smootherstep(progress.as_millis() as f32 / total_t.as_millis() as f32); let handle = self.config.get_hide_handle().unwrap() as i32; + self.is_dirty = true; if let FocusStatus::LastFocused(_) = cur_hover { // start transition to visible @@ -626,29 +619,16 @@ impl PanelSpace { if self.config.exclusive_zone() { layer_surface.set_exclusive_zone(panel_size); } - Self::set_margin( - self.config.anchor, - self.config.get_margin() as i32, - 0, - self.additional_gap, - layer_surface, - ); - layer_shell_wl_surface.commit(); + + self.anchor_gap = 0; self.visibility = Visibility::Visible; } else { if prev_margin != cur_pix { if self.config.exclusive_zone() { layer_surface.set_exclusive_zone(panel_size - cur_pix); } - let margin = self.config.get_margin() as i32; - Self::set_margin( - self.config.anchor, - margin, - cur_pix, - self.additional_gap, - layer_surface, - ); - layer_shell_wl_surface.commit(); + + self.anchor_gap = cur_pix; } self.visibility = Visibility::TransitionToVisible { last_instant: now, @@ -664,23 +644,14 @@ impl PanelSpace { fn set_margin( anchor: PanelAnchor, margin: i32, - target: i32, additional_gap: i32, layer_surface: &LayerSurface, ) { match anchor { - PanelAnchor::Left => { - layer_surface.set_margin(margin, 0, margin, target + additional_gap) - }, - PanelAnchor::Right => { - layer_surface.set_margin(margin, target + additional_gap, margin, 0) - }, - PanelAnchor::Top => { - layer_surface.set_margin(target + additional_gap, margin, 0, margin) - }, - PanelAnchor::Bottom => { - layer_surface.set_margin(0, margin, target + additional_gap, margin) - }, + PanelAnchor::Left => layer_surface.set_margin(margin, 0, margin, additional_gap), + PanelAnchor::Right => layer_surface.set_margin(margin, additional_gap, margin, 0), + PanelAnchor::Top => layer_surface.set_margin(additional_gap, margin, 0, margin), + PanelAnchor::Bottom => layer_surface.set_margin(0, margin, additional_gap, margin), }; } @@ -786,10 +757,10 @@ impl PanelSpace { Self::set_margin( self.config.anchor, self.config.get_margin() as i32, - 0, self.additional_gap, layer, ); + self.anchor_gap = 0; } } } @@ -840,10 +811,10 @@ impl PanelSpace { Self::set_margin( self.config.anchor, self.config.get_effective_anchor_gap() as i32, - 0, self.additional_gap, layer_surface, ); + self.anchor_gap = 0; } } else if self.config.autohide.is_some() && matches!(self.visibility, Visibility::Hidden) @@ -854,11 +825,11 @@ impl PanelSpace { Self::set_margin( self.config.anchor, self.config.get_margin() as i32, - -(list_thickness as i32) - + self.config.get_hide_handle().unwrap_or_default() as i32, self.additional_gap, layer_surface, ); + self.anchor_gap = -(list_thickness as i32) + + self.config.get_hide_handle().unwrap_or_default() as i32; } layer_surface.wl_surface().commit(); layer_surface.wl_surface().frame(qh, layer_surface.wl_surface().clone()); @@ -1251,7 +1222,8 @@ impl PanelSpace { if config.autohide.is_none() && self.config.autohide.is_some() { if let Some(l) = self.layer.as_ref() { let margin = config.get_effective_anchor_gap() as i32; - Self::set_margin(config.anchor, margin, 0, self.additional_gap, l); + Self::set_margin(config.anchor, margin, self.additional_gap, l); + self.anchor_gap = 0; let list_thickness = match self.config.anchor() { PanelAnchor::Left | PanelAnchor::Right => self.dimensions.w, PanelAnchor::Top | PanelAnchor::Bottom => self.dimensions.h, @@ -1268,7 +1240,8 @@ impl PanelSpace { } else if self.config.get_effective_anchor_gap() != config.get_effective_anchor_gap() { if let Some(l) = self.layer.as_ref() { let margin = config.get_effective_anchor_gap() as i32; - Self::set_margin(config.anchor, margin, 0, self.additional_gap, l); + Self::set_margin(config.anchor, margin, self.additional_gap, l); + self.anchor_gap = 0; needs_commit = true; } } diff --git a/cosmic-panel-bin/src/space/render.rs b/cosmic-panel-bin/src/space/render.rs index ded6972..5bfea4a 100644 --- a/cosmic-panel-bin/src/space/render.rs +++ b/cosmic-panel-bin/src/space/render.rs @@ -11,6 +11,7 @@ use cctk::wayland_client::{Proxy, QueueHandle}; use itertools::Itertools; use crate::xdg_shell_wrapper::shared_state::GlobalState; +use cosmic_panel_config::PanelAnchor; use sctk::shell::WaylandSurface; use smithay::{ backend::renderer::{ @@ -24,8 +25,9 @@ use smithay::{ gles::{GlesError, GlesFrame, GlesRenderer}, Bind, Color32F, Frame, Renderer, Unbind, }, - utils::{Buffer, Physical, Rectangle}, + utils::{Buffer, Physical, Point, Rectangle}, }; + pub(crate) enum PanelRenderElement { Wayland(WaylandSurfaceRenderElement), Crop(CropRenderElement>), @@ -157,8 +159,17 @@ impl PanelSpace { return Ok(()); } + let anim_gap_physical = (self.anchor_gap as f64) * self.scale; + let anim_gap_translation = Point::from(match self.config.anchor { + PanelAnchor::Left => (anim_gap_physical, 0.), + PanelAnchor::Right => (-anim_gap_physical, 0.), + PanelAnchor::Top => (0., anim_gap_physical), + PanelAnchor::Bottom => (0., -anim_gap_physical), + }) + .to_i32_round(); if let Some((o, _info)) = &self.output.as_ref().map(|(_, o, info)| (o, info)) { let mut elements: Vec = (self.config.anchor_gap + || self.anchor_gap != 0 || self.config.border_radius > 0) .then(|| { PanelRenderElement::RoundedRectangle(RoundedRectangleShader::element( @@ -178,7 +189,8 @@ impl PanelSpace { .unwrap_or_default() .to_f64() .to_physical(self.scale) - .to_i32_round(); + .to_i32_round() + + anim_gap_translation; if let CosmicMappedInternal::OverflowButton(b) = w { return Some( @@ -244,8 +256,10 @@ impl PanelSpace { let pos = e.with_program(|p| p.logical_pos); e.render_elements( renderer, - ((pos.0 as f64 * self.scale) as i32, (pos.1 as f64 * self.scale) as i32) - .into(), + Point::from(( + (pos.0 as f64 * self.scale) as i32, + (pos.1 as f64 * self.scale) as i32, + )) + anim_gap_translation, self.scale.into(), 1.0, ) From d9b7a2cd283f792412525a146f2af1a8c083fbac Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Mon, 25 Nov 2024 15:27:10 -0500 Subject: [PATCH 2/8] feat: intellihide --- cosmic-panel-bin/src/config_watching.rs | 5 +- cosmic-panel-bin/src/main.rs | 3 +- cosmic-panel-bin/src/space/panel_space.rs | 45 +- cosmic-panel-bin/src/space/wrapper_space.rs | 17 + .../src/space_container/space_container.rs | 16 +- .../src/space_container/wrapper_space.rs | 6 + .../xdg_shell_wrapper/client/handlers/mod.rs | 1 + .../client/handlers/overlap.rs | 84 ++ .../src/xdg_shell_wrapper/client/state.rs | 17 +- cosmic-panel-bin/src/xdg_shell_wrapper/mod.rs | 4 +- .../src/xdg_shell_wrapper/protocols/mod.rs | 3 - .../protocols/toplevel_info.rs | 487 --------- .../protocols/toplevel_management.rs | 231 ----- .../xdg_shell_wrapper/protocols/workspace.rs | 969 ------------------ .../xdg_shell_wrapper/server/handlers/mod.rs | 9 +- .../src/xdg_shell_wrapper/space/space.rs | 4 +- cosmic-panel-config/src/container_config.rs | 1 + cosmic-panel-config/src/panel_config.rs | 8 +- 18 files changed, 188 insertions(+), 1722 deletions(-) create mode 100644 cosmic-panel-bin/src/xdg_shell_wrapper/client/handlers/overlap.rs delete mode 100644 cosmic-panel-bin/src/xdg_shell_wrapper/protocols/mod.rs delete mode 100644 cosmic-panel-bin/src/xdg_shell_wrapper/protocols/toplevel_info.rs delete mode 100644 cosmic-panel-bin/src/xdg_shell_wrapper/protocols/toplevel_management.rs delete mode 100644 cosmic-panel-bin/src/xdg_shell_wrapper/protocols/workspace.rs diff --git a/cosmic-panel-bin/src/config_watching.rs b/cosmic-panel-bin/src/config_watching.rs index a7b1817..21e6f01 100644 --- a/cosmic-panel-bin/src/config_watching.rs +++ b/cosmic-panel-bin/src/config_watching.rs @@ -112,7 +112,8 @@ pub fn watch_config( channel::Event::Msg(ConfigUpdate::Entries(entries)) => { let to_update = entries .iter() - .filter(|c| !state.space.config.config_list.iter().any(|e| e.name == **c)).cloned() + .filter(|c| !state.space.config.config_list.iter().any(|e| e.name == **c)) + .cloned() .collect::>(); info!("Received entries: {:?}", to_update); for entry in to_update { @@ -164,6 +165,7 @@ pub fn watch_config( &mut state.client_state.layer_state, &state.client_state.queue_handle, None, + state.client_state.overlap_notify.clone(), ); } info!("Removing entries: {:?}", entries); @@ -188,6 +190,7 @@ pub fn watch_config( &mut state.client_state.layer_state, &state.client_state.queue_handle, None, + state.client_state.overlap_notify.clone(), ); }, channel::Event::Closed => {}, diff --git a/cosmic-panel-bin/src/main.rs b/cosmic-panel-bin/src/main.rs index a9a6e17..74a1dc4 100644 --- a/cosmic-panel-bin/src/main.rs +++ b/cosmic-panel-bin/src/main.rs @@ -44,7 +44,7 @@ fn main() -> Result<()> { let filter_layer = EnvFilter::try_from_default_env().or_else(|_| EnvFilter::try_new("warn")).unwrap(); if let Ok(journal_layer) = tracing_journald::layer() { - tracing_subscriber::registry().with(journal_layer).with(filter_layer).init(); + tracing_subscriber::registry().with(fmt_layer).with(filter_layer).init(); } else { tracing_subscriber::registry().with(fmt_layer).with(filter_layer).init(); } @@ -130,6 +130,7 @@ fn main() -> Result<()> { &mut state.client_state.layer_state, &state.client_state.queue_handle, Some(o), + state.client_state.overlap_notify.clone(), ); }, PanelCalloopMsg::UpdateToplevel(toplevel) => { diff --git a/cosmic-panel-bin/src/space/panel_space.rs b/cosmic-panel-bin/src/space/panel_space.rs index dc0aeec..a8c3e57 100644 --- a/cosmic-panel-bin/src/space/panel_space.rs +++ b/cosmic-panel-bin/src/space/panel_space.rs @@ -1,5 +1,6 @@ use std::{ cell::{Cell, RefCell}, + collections::HashSet, fmt::Debug, os::{fd::OwnedFd, unix::net::UnixStream}, rc::Rc, @@ -11,6 +12,7 @@ use std::{ use crate::{ iced::elements::{background::BackgroundElement, PopupMappedInternal}, xdg_shell_wrapper::{ + client::handlers::overlap::OverlapNotifyV1, client_state::{ClientFocus, FocusStatus}, server_state::{ServerFocus, ServerPtrFocus}, shared_state::GlobalState, @@ -22,7 +24,10 @@ use crate::{ wp_security_context::SecurityContextManager, }, }; -use cctk::wayland_client::Connection; +use cctk::{ + cosmic_protocols::overlap_notify::v1::client::zcosmic_overlap_notification_v1::ZcosmicOverlapNotificationV1, + wayland_client::Connection, +}; use cosmic::iced::id; use launch_pad::process::Process; @@ -308,6 +313,9 @@ pub struct PanelSpace { pub remap_attempts: u32, pub background_element: Option, pub last_minimize_update: Instant, + pub(crate) toplevel_overlaps: HashSet, + pub(crate) notification_subscription: Option, + pub(crate) overlap_notify: Option, } impl PanelSpace { @@ -384,6 +392,9 @@ impl PanelSpace { background_element: None, last_minimize_update: Instant::now() - Duration::from_secs(1), anchor_gap: 0, + toplevel_overlaps: HashSet::new(), + notification_subscription: None, + overlap_notify: None, } } @@ -437,14 +448,16 @@ impl PanelSpace { return; }; - let cur_hover = { + let (cur_hover, intellihide) = { let c_focused_surface = self.c_focused_surface.borrow(); let c_hovered_surface = self.c_hovered_surface.borrow(); // no transition if not configured for autohide let no_hover_focus = c_focused_surface.iter().all(|f| matches!(f.2, FocusStatus::LastFocused(_))) && c_hovered_surface.iter().all(|f| matches!(f.2, FocusStatus::LastFocused(_))); - if self.config.autohide().is_none() { + let intellihide = if let Some(autohide) = self.config.autohide() { + autohide.intellihide && self.overlap_notify.is_some() + } else { if no_hover_focus && self.animate_state.is_none() { self.additional_gap = 0; self.visibility = Visibility::Hidden; @@ -452,9 +465,9 @@ impl PanelSpace { self.visibility = Visibility::Visible; } return; - } + }; - c_hovered_surface.iter().fold( + let f = c_hovered_surface.iter().fold( if self.animate_state.is_some() || !self.output_has_toplevel { FocusStatus::Focused } else { @@ -486,11 +499,15 @@ impl PanelSpace { acc } }, - ) + ); + (f, intellihide) }; + match self.visibility { Visibility::Hidden => { - if let FocusStatus::Focused = cur_hover { + if matches!(cur_hover, FocusStatus::Focused) + || (intellihide && self.toplevel_overlaps.is_empty()) + { // start transition to visible let margin = match self.config.anchor() { PanelAnchor::Left | PanelAnchor::Right => -(self.dimensions.w), @@ -512,7 +529,9 @@ impl PanelSpace { None => return, }; self.is_dirty = true; - if duration_since_last_focus > self.config.get_hide_wait().unwrap() { + if duration_since_last_focus > self.config.get_hide_wait().unwrap() + && (!intellihide || !self.toplevel_overlaps.is_empty()) + { self.visibility = Visibility::TransitionToHidden { last_instant: Instant::now(), progress: Duration::new(0, 0), @@ -538,7 +557,9 @@ impl PanelSpace { let handle = self.config.get_hide_handle().unwrap() as i32; self.is_dirty = true; - if let FocusStatus::Focused = cur_hover { + if matches!(cur_hover, FocusStatus::Focused) + || (intellihide && self.toplevel_overlaps.is_empty()) + { // start transition to visible self.visibility = Visibility::TransitionToVisible { last_instant: now, @@ -597,8 +618,10 @@ impl PanelSpace { let handle = self.config.get_hide_handle().unwrap() as i32; self.is_dirty = true; - if let FocusStatus::LastFocused(_) = cur_hover { - // start transition to visible + if matches!(cur_hover, FocusStatus::LastFocused(_)) + && (!intellihide || !self.toplevel_overlaps.is_empty()) + { + // start transition to hide self.close_popups(|_| false); self.visibility = Visibility::TransitionToHidden { last_instant: now, diff --git a/cosmic-panel-bin/src/space/wrapper_space.rs b/cosmic-panel-bin/src/space/wrapper_space.rs index ee54c2e..bea7e4a 100644 --- a/cosmic-panel-bin/src/space/wrapper_space.rs +++ b/cosmic-panel-bin/src/space/wrapper_space.rs @@ -13,6 +13,7 @@ use crate::{ space::panel_space::ClientShrinkSize, space_container::SpaceContainer, xdg_shell_wrapper::{ + client::handlers::overlap::{OverlapNotificationV1, OverlapNotifyV1}, client_state::ClientFocus, server_state::ServerPointerFocus, shared_state::GlobalState, @@ -33,6 +34,7 @@ use itertools::izip; use launch_pad::process::Process; use sctk::{ compositor::{CompositorState, Region}, + globals::GlobalData, output::OutputInfo, reexports::client::{ protocol::{wl_output as c_wl_output, wl_surface as c_wl_surface}, @@ -816,7 +818,9 @@ impl WrapperSpace for PanelSpace { _layer_state: &mut LayerShell, _conn: &Connection, _qh: &QueueHandle, + overlap_notify: Option, ) { + self.overlap_notify = overlap_notify; } /// returns false to forward the button press, and true to intercept @@ -1366,6 +1370,19 @@ impl WrapperSpace for PanelSpace { let viewport = viewport.map(|v| v.get_viewport(client_surface.wl_surface(), qh)); client_surface.commit(); + if let Some(notify) = self.overlap_notify.as_ref() { + let notification = notify.notify.notify_on_overlap( + match client_surface.kind() { + sctk::shell::wlr_layer::SurfaceKind::Wlr(zwlr_layer_surface_v1) => { + zwlr_layer_surface_v1 + }, + _ => unimplemented!(), + }, + qh, + OverlapNotificationV1 { surface: client_surface.wl_surface().clone() }, + ); + self.notification_subscription = Some(notification); + } let next_render_event = Rc::new(Cell::new(Some(SpaceEvent::WaitConfigure { first: true, diff --git a/cosmic-panel-bin/src/space_container/space_container.rs b/cosmic-panel-bin/src/space_container/space_container.rs index c34f07c..dc297f3 100644 --- a/cosmic-panel-bin/src/space_container/space_container.rs +++ b/cosmic-panel-bin/src/space_container/space_container.rs @@ -1,10 +1,16 @@ -use std::{cell::RefCell, collections::HashMap, rc::Rc, sync::Arc}; +use std::{ + cell::RefCell, + collections::{HashMap, HashSet}, + rc::Rc, + sync::Arc, +}; use crate::{ minimize::MinimizeApplet, space::{AppletMsg, PanelColors, PanelSpace}, - xdg_shell_wrapper, xdg_shell_wrapper::{ + self, + client::handlers::overlap::OverlapNotifyV1, client_state::ClientFocus, shared_state::GlobalState, space::{Visibility, WrapperSpace}, @@ -16,7 +22,8 @@ use crate::{ }; use cctk::{ cosmic_protocols::toplevel_info::v1::client::zcosmic_toplevel_handle_v1::ZcosmicToplevelHandleV1, - toplevel_info::ToplevelInfo, wayland_client::protocol::wl_seat::WlSeat, + toplevel_info::ToplevelInfo, + wayland_client::{self, protocol::wl_seat::WlSeat}, workspace::WorkspaceGroup, }; use cosmic::{cosmic_config::CosmicConfigEntry, iced::id, theme}; @@ -65,6 +72,7 @@ pub struct SpaceContainer { /// map from output name to minimized applet info pub(crate) minimized_applets: HashMap, pub(crate) loop_handle: calloop::LoopHandle<'static, GlobalState>, + pub(crate) overlap_notify: Option, } impl SpaceContainer { @@ -110,6 +118,7 @@ impl SpaceContainer { security_context_manager: None, minimized_applets: HashMap::new(), loop_handle, + overlap_notify: None, } } @@ -215,6 +224,7 @@ impl SpaceContainer { layer_state: &mut LayerShell, qh: &QueueHandle, force_output: Option, + overlap_notify: Option, ) { // if the output is set to "all", we need to check if the config is the same for // all outputs if the output is set to a specific output, we need to diff --git a/cosmic-panel-bin/src/space_container/wrapper_space.rs b/cosmic-panel-bin/src/space_container/wrapper_space.rs index 52506fb..47cf897 100644 --- a/cosmic-panel-bin/src/space_container/wrapper_space.rs +++ b/cosmic-panel-bin/src/space_container/wrapper_space.rs @@ -7,6 +7,7 @@ use std::{ use crate::{ iced::elements::target::SpaceTarget, xdg_shell_wrapper::{ + client::handlers::overlap::OverlapNotifyV1, client_state::{ClientFocus, FocusStatus}, server_state::ServerPointerFocus, shared_state::GlobalState, @@ -16,6 +17,7 @@ use crate::{ wp_viewporter::ViewporterState, }, }; +use cctk::cosmic_protocols::overlap_notify; use cosmic_panel_config::{CosmicPanelBackground, CosmicPanelContainerConfig, CosmicPanelOuput}; use itertools::Itertools; use sctk::{ @@ -69,7 +71,9 @@ impl WrapperSpace for SpaceContainer { layer_state: &mut LayerShell, conn: &Connection, qh: &QueueHandle, + overlap_notify: Option, ) { + self.overlap_notify = overlap_notify.clone(); self.connection = Some(conn.clone()); self.security_context_manager = security_context_manager.clone(); @@ -112,6 +116,7 @@ impl WrapperSpace for SpaceContainer { layer_state, conn, qh, + overlap_notify.clone(), ); if let Some(s_display) = self.s_display.as_ref() { s.set_display_handle(s_display.clone()); @@ -220,6 +225,7 @@ impl WrapperSpace for SpaceContainer { layer_state, conn, qh, + self.overlap_notify.clone(), ); if let Some(s_display) = self.s_display.as_ref() { s.set_display_handle(s_display.clone()); diff --git a/cosmic-panel-bin/src/xdg_shell_wrapper/client/handlers/mod.rs b/cosmic-panel-bin/src/xdg_shell_wrapper/client/handlers/mod.rs index eddd302..9c0b357 100644 --- a/cosmic-panel-bin/src/xdg_shell_wrapper/client/handlers/mod.rs +++ b/cosmic-panel-bin/src/xdg_shell_wrapper/client/handlers/mod.rs @@ -17,6 +17,7 @@ pub mod keyboard; pub mod layer_shell; /// output helpers pub mod output; +pub mod overlap; pub mod pointer; pub mod seat; pub mod shell; diff --git a/cosmic-panel-bin/src/xdg_shell_wrapper/client/handlers/overlap.rs b/cosmic-panel-bin/src/xdg_shell_wrapper/client/handlers/overlap.rs new file mode 100644 index 0000000..b16ec7e --- /dev/null +++ b/cosmic-panel-bin/src/xdg_shell_wrapper/client/handlers/overlap.rs @@ -0,0 +1,84 @@ +use cctk::{ + cosmic_protocols::overlap_notify::v1::client::{ + zcosmic_overlap_notification_v1::{self, ZcosmicOverlapNotificationV1}, + zcosmic_overlap_notify_v1::ZcosmicOverlapNotifyV1, + }, + wayland_client::{ + self, event_created_child, + globals::{BindError, GlobalList}, + protocol::wl_surface::WlSurface, + Connection, Dispatch, Proxy, QueueHandle, + }, + wayland_protocols::ext::foreign_toplevel_list::v1::client::ext_foreign_toplevel_handle_v1::ExtForeignToplevelHandleV1, +}; +use sctk::{globals::GlobalData, shell::WaylandSurface}; + +use crate::xdg_shell_wrapper::shared_state::GlobalState; + +#[derive(Debug, Clone)] +pub struct OverlapNotifyV1 { + pub(crate) notify: ZcosmicOverlapNotifyV1, +} + +impl OverlapNotifyV1 { + pub fn bind( + globals: &GlobalList, + qh: &QueueHandle, + ) -> Result { + let notify = globals.bind(qh, 1..=1, GlobalData)?; + Ok(OverlapNotifyV1 { notify }) + } +} + +impl Dispatch for OverlapNotifyV1 { + fn event( + _: &mut GlobalState, + _: &ZcosmicOverlapNotifyV1, + _: ::Event, + _: &GlobalData, + _: &Connection, + _: &QueueHandle, + ) { + } +} + +#[derive(Debug)] +pub struct OverlapNotificationV1 { + pub surface: WlSurface, +} + +impl Dispatch + for OverlapNotificationV1 +{ + fn event( + state: &mut GlobalState, + _n: &ZcosmicOverlapNotificationV1, + event: ::Event, + data: &OverlapNotificationV1, + _: &Connection, + _: &QueueHandle, + ) { + let my_surface = &data.surface; + for s in &mut state.space.space_list { + if !s.layer.as_ref().is_some_and(|l| l.wl_surface() == my_surface) { + continue; + } + match event { + zcosmic_overlap_notification_v1::Event::ToplevelEnter { ref toplevel, .. } => { + s.toplevel_overlaps.insert(toplevel.id()); + }, + zcosmic_overlap_notification_v1::Event::ToplevelLeave { ref toplevel } => { + s.toplevel_overlaps.remove(&toplevel.id()); + }, + _ => {}, + } + } + } + + event_created_child!(GlobalState, ZcosmicOverlapNotifyV1, [ + 0 => (ExtForeignToplevelHandleV1, Default::default()) + ]); +} + +wayland_client::delegate_dispatch!(GlobalState: [ZcosmicOverlapNotifyV1: GlobalData] => OverlapNotifyV1); +wayland_client::delegate_dispatch!(GlobalState: [ZcosmicOverlapNotificationV1: OverlapNotificationV1] => OverlapNotificationV1); diff --git a/cosmic-panel-bin/src/xdg_shell_wrapper/client/state.rs b/cosmic-panel-bin/src/xdg_shell_wrapper/client/state.rs index f0503cd..47304a6 100644 --- a/cosmic-panel-bin/src/xdg_shell_wrapper/client/state.rs +++ b/cosmic-panel-bin/src/xdg_shell_wrapper/client/state.rs @@ -5,8 +5,9 @@ use crate::{ }, }; use cctk::{ - toplevel_info::ToplevelInfoState, toplevel_management::ToplevelManagerState, - wayland_client::protocol::wl_pointer::WlPointer, workspace::WorkspaceState, + cosmic_protocols::overlap_notify, toplevel_info::ToplevelInfoState, + toplevel_management::ToplevelManagerState, wayland_client::protocol::wl_pointer::WlPointer, + workspace::WorkspaceState, }; use sctk::{ compositor::CompositorState, @@ -76,8 +77,8 @@ use wayland_protocols::wp::{ }; use super::handlers::{ - wp_fractional_scaling::FractionalScalingManager, wp_security_context::SecurityContextManager, - wp_viewporter::ViewporterState, + overlap::OverlapNotifyV1, wp_fractional_scaling::FractionalScalingManager, + wp_security_context::SecurityContextManager, wp_viewporter::ViewporterState, }; #[derive(Debug)] @@ -153,6 +154,8 @@ pub struct ClientState { pub workspace_state: Option, /// security context manager pub security_context_manager: Option, + /// overlap notifications subscription + pub overlap_notify: Option, pub(crate) connection: Connection, /// queue handle @@ -275,6 +278,10 @@ impl ClientState { }, Ok(m) => Some(m), }; + let overlap_notify = OverlapNotifyV1::bind(&globals, &qh); + if let Err(err) = &overlap_notify { + tracing::warn!("Failed to bind to overlap notify {err:?}"); + } let client_state = ClientState { focused_surface: space.get_client_focused_surface(), @@ -293,6 +300,8 @@ impl ClientState { layer_state: LayerShell::bind(&globals, &qh).expect("layer shell is not available"), data_device_manager: DataDeviceManagerState::bind(&globals, &qh) .expect("data device manager is not available"), + overlap_notify: overlap_notify.ok(), + outputs: Default::default(), registry_state, multipool: None, diff --git a/cosmic-panel-bin/src/xdg_shell_wrapper/mod.rs b/cosmic-panel-bin/src/xdg_shell_wrapper/mod.rs index 2624d56..83eb0fa 100644 --- a/cosmic-panel-bin/src/xdg_shell_wrapper/mod.rs +++ b/cosmic-panel-bin/src/xdg_shell_wrapper/mod.rs @@ -23,12 +23,11 @@ pub use server::state as server_state; use server::state::ServerState; use shared_state::GlobalState; use space::{Visibility, WrapperSpace}; -use tracing::info; pub use xdg_shell_wrapper_config as config; use crate::space_container::SpaceContainer; -mod client; +pub(crate) mod client; mod server; /// shared state pub mod shared_state; @@ -60,6 +59,7 @@ pub fn run( &mut global_state.client_state.layer_state, &global_state.client_state.connection, &global_state.client_state.queue_handle, + global_state.client_state.overlap_notify.clone(), ); // // remove extra looping after launch-pad is integrated diff --git a/cosmic-panel-bin/src/xdg_shell_wrapper/protocols/mod.rs b/cosmic-panel-bin/src/xdg_shell_wrapper/protocols/mod.rs deleted file mode 100644 index 9013ec0..0000000 --- a/cosmic-panel-bin/src/xdg_shell_wrapper/protocols/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub mod toplevel_info; -pub mod toplevel_management; -pub mod workspace; diff --git a/cosmic-panel-bin/src/xdg_shell_wrapper/protocols/toplevel_info.rs b/cosmic-panel-bin/src/xdg_shell_wrapper/protocols/toplevel_info.rs deleted file mode 100644 index 917b838..0000000 --- a/cosmic-panel-bin/src/xdg_shell_wrapper/protocols/toplevel_info.rs +++ /dev/null @@ -1,487 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 - -use std::{collections::HashMap, sync::Mutex}; - -use smithay::{ - desktop::Window, - output::Output, - reexports::{ - wayland_protocols::xdg::shell::server::xdg_toplevel, - wayland_server::{ - backend::{ClientId, GlobalId, ObjectId}, - protocol::wl_surface::WlSurface, - Client, DataInit, Dispatch, DisplayHandle, GlobalDispatch, New, Resource, - }, - }, - utils::{IsAlive, Logical, Rectangle}, - wayland::{compositor::with_states, shell::xdg::XdgToplevelSurfaceRoleAttributes}, -}; - -use super::workspace::{WorkspaceHandle, WorkspaceHandler, WorkspaceState}; - -use cosmic_protocols::toplevel_info::v1::server::{ - zcosmic_toplevel_handle_v1::{self, State as States, ZcosmicToplevelHandleV1}, - zcosmic_toplevel_info_v1::{self, ZcosmicToplevelInfoV1}, -}; - -pub struct ToplevelInfoState { - dh: DisplayHandle, - pub(super) toplevels: Vec, - instances: Vec, - global: GlobalId, - _dispatch_data: std::marker::PhantomData, -} - -pub trait ToplevelInfoHandler: WorkspaceHandler + Sized { - fn toplevel_info_state(&self) -> &ToplevelInfoState; - fn toplevel_info_state_mut(&mut self) -> &mut ToplevelInfoState; -} - -pub struct ToplevelInfoGlobalData { - filter: Box Fn(&'a Client) -> bool + Send + Sync>, -} - -#[derive(Default)] -pub(super) struct ToplevelStateInner { - instances: Vec, - outputs: Vec, - workspaces: Vec, - minimized: bool, - pub(super) rectangles: HashMap)>, -} -pub(super) type ToplevelState = Mutex; - -pub struct ToplevelHandleStateInner { - outputs: Vec, - workspaces: Vec, - title: String, - app_id: String, - states: Vec, - pub(super) window: Window, -} -pub type ToplevelHandleState = Mutex; - -impl ToplevelHandleStateInner { - fn from_window(window: &Window) -> ToplevelHandleState { - ToplevelHandleState::new(ToplevelHandleStateInner { - outputs: Vec::new(), - workspaces: Vec::new(), - title: String::new(), - app_id: String::new(), - states: Vec::new(), - window: window.clone(), - }) - } -} - -impl GlobalDispatch for ToplevelInfoState -where - D: GlobalDispatch - + Dispatch - + Dispatch - + ToplevelInfoHandler - + 'static, -{ - fn bind( - state: &mut D, - dh: &DisplayHandle, - _client: &Client, - resource: New, - _global_data: &ToplevelInfoGlobalData, - data_init: &mut DataInit<'_, D>, - ) { - let instance = data_init.init(resource, ()); - for window in &state.toplevel_info_state().toplevels { - send_toplevel_to_client::(dh, Some(state.workspace_state()), &instance, window); - } - state.toplevel_info_state_mut().instances.push(instance); - } - - fn can_view(client: Client, global_data: &ToplevelInfoGlobalData) -> bool { - (global_data.filter)(&client) - } -} - -impl Dispatch for ToplevelInfoState -where - D: GlobalDispatch - + Dispatch - + Dispatch - + ToplevelInfoHandler - + 'static, -{ - fn request( - state: &mut D, - _client: &Client, - obj: &ZcosmicToplevelInfoV1, - request: zcosmic_toplevel_info_v1::Request, - _data: &(), - _dh: &DisplayHandle, - _data_init: &mut DataInit<'_, D>, - ) { - match request { - zcosmic_toplevel_info_v1::Request::Stop => { - state - .toplevel_info_state_mut() - .instances - .retain(|i| i != obj); - } - _ => {} - } - } - - fn destroyed(state: &mut D, _client: ClientId, resource: ObjectId, _data: &()) { - state - .toplevel_info_state_mut() - .instances - .retain(|i| i.id() != resource); - } -} - -impl Dispatch for ToplevelInfoState -where - D: GlobalDispatch - + Dispatch - + Dispatch - + ToplevelInfoHandler - + 'static, -{ - fn request( - _state: &mut D, - _client: &Client, - _obj: &ZcosmicToplevelHandleV1, - request: zcosmic_toplevel_handle_v1::Request, - _data: &ToplevelHandleState, - _dh: &DisplayHandle, - _data_init: &mut DataInit<'_, D>, - ) { - match request { - zcosmic_toplevel_handle_v1::Request::Destroy => {} - _ => {} - } - } - - fn destroyed( - state: &mut D, - _client: ClientId, - resource: ObjectId, - _data: &ToplevelHandleState, - ) { - for toplevel in &state.toplevel_info_state_mut().toplevels { - if let Some(state) = toplevel.user_data().get::() { - state - .lock() - .unwrap() - .instances - .retain(|i| i.id() != resource); - } - } - } -} - -impl ToplevelInfoState -where - D: GlobalDispatch - + Dispatch - + Dispatch - + ToplevelInfoHandler - + 'static, -{ - pub fn new(dh: &DisplayHandle, client_filter: F) -> ToplevelInfoState - where - F: for<'a> Fn(&'a Client) -> bool + Send + Sync + 'static, - { - let global = dh.create_global::( - 1, - ToplevelInfoGlobalData { - filter: Box::new(client_filter), - }, - ); - ToplevelInfoState { - dh: dh.clone(), - toplevels: Vec::new(), - instances: Vec::new(), - global, - _dispatch_data: std::marker::PhantomData, - } - } - - pub fn new_toplevel(&mut self, toplevel: &Window) { - toplevel - .user_data() - .insert_if_missing(ToplevelState::default); - for instance in &self.instances { - send_toplevel_to_client::(&self.dh, None, instance, toplevel); - } - self.toplevels.push(toplevel.clone()); - } - - pub fn toplevel_enter_output(&mut self, toplevel: &Window, output: &Output) { - if let Some(state) = toplevel.user_data().get::() { - state.lock().unwrap().outputs.push(output.clone()); - } - } - - pub fn toplevel_leave_output(&mut self, toplevel: &Window, output: &Output) { - if let Some(state) = toplevel.user_data().get::() { - state.lock().unwrap().outputs.retain(|o| o != output); - } - } - - pub fn toplevel_enter_workspace(&mut self, toplevel: &Window, workspace: &WorkspaceHandle) { - if let Some(state) = toplevel.user_data().get::() { - state.lock().unwrap().workspaces.push(workspace.clone()); - } - } - - pub fn toplevel_leave_workspace(&mut self, toplevel: &Window, workspace: &WorkspaceHandle) { - if let Some(state) = toplevel.user_data().get::() { - state.lock().unwrap().workspaces.retain(|w| w != workspace); - } - } - - pub fn refresh(&mut self, workspace_state: Option<&WorkspaceState>) { - self.toplevels.retain(|window| { - let mut state = window - .user_data() - .get::() - .unwrap() - .lock() - .unwrap(); - state.rectangles.retain(|_, (surface, _)| surface.alive()); - if window.alive() { - std::mem::drop(state); - for instance in &self.instances { - send_toplevel_to_client::(&self.dh, workspace_state, instance, window); - } - true - } else { - for handle in &state.instances { - // don't send events to stopped instances - if self - .instances - .iter() - .any(|i| i.id().same_client_as(&handle.id())) - { - handle.closed(); - } - } - false - } - }); - } - - pub fn global_id(&self) -> GlobalId { - self.global.clone() - } -} - -fn send_toplevel_to_client( - dh: &DisplayHandle, - workspace_state: Option<&WorkspaceState>, - info: &ZcosmicToplevelInfoV1, - window: &Window, -) where - D: GlobalDispatch - + Dispatch - + Dispatch - + ToplevelInfoHandler - + 'static, -{ - let mut state = window - .user_data() - .get::() - .unwrap() - .lock() - .unwrap(); - let instance = match state - .instances - .iter() - .find(|i| i.id().same_client_as(&info.id())) - { - Some(i) => i, - None => { - if let Ok(client) = dh.get_client(info.id()) { - if let Ok(toplevel_handle) = client - .create_resource::( - dh, - info.version(), - ToplevelHandleStateInner::from_window(window), - ) - { - info.toplevel(&toplevel_handle); - state.instances.push(toplevel_handle); - state.instances.last().unwrap() - } else { - return; - } - } else { - return; - } - } - }; - - let mut handle_state = instance - .data::() - .unwrap() - .lock() - .unwrap(); - let mut changed = false; - with_states(window.toplevel().wl_surface(), |states| { - let attributes = states - .data_map - .get::>() - .unwrap() - .lock() - .unwrap(); - - if handle_state.title != attributes.title.as_deref().unwrap_or(&"") { - handle_state.title = attributes.title.clone().unwrap_or_else(String::new); - instance.title(handle_state.title.clone()); - changed = true; - } - if handle_state.app_id != attributes.app_id.as_deref().unwrap_or(&"") { - handle_state.app_id = attributes.app_id.clone().unwrap_or_else(String::new); - instance.app_id(handle_state.app_id.clone()); - changed = true; - } - - if (handle_state.states.contains(&States::Maximized) - != attributes - .current - .states - .contains(xdg_toplevel::State::Maximized)) - || (handle_state.states.contains(&States::Fullscreen) - != attributes - .current - .states - .contains(xdg_toplevel::State::Fullscreen)) - || (handle_state.states.contains(&States::Activated) - != attributes - .current - .states - .contains(xdg_toplevel::State::Activated)) - || (handle_state.states.contains(&States::Minimized) != state.minimized) - { - let mut states = Vec::new(); - if attributes - .current - .states - .contains(xdg_toplevel::State::Maximized) - { - states.push(States::Maximized); - } - if attributes - .current - .states - .contains(xdg_toplevel::State::Fullscreen) - { - states.push(States::Fullscreen); - } - if attributes - .current - .states - .contains(xdg_toplevel::State::Activated) - { - states.push(States::Activated); - } - if attributes - .current - .states - .contains(xdg_toplevel::State::Maximized) - { - states.push(States::Maximized); - } - handle_state.states = states.clone(); - - let states: Vec = { - let ratio = std::mem::size_of::() / std::mem::size_of::(); - let ptr = states.as_mut_ptr() as *mut u8; - let len = states.len() * ratio; - let cap = states.capacity() * ratio; - std::mem::forget(states); - unsafe { Vec::from_raw_parts(ptr, len, cap) } - }; - instance.state(states); - changed = true; - } - }); - - if let Ok(client) = dh.get_client(instance.id()) { - for new_output in state - .outputs - .iter() - .filter(|o| !handle_state.outputs.contains(o)) - { - for wl_output in new_output.client_outputs(&client) { - instance.output_enter(&wl_output); - } - changed = true; - } - for old_output in handle_state - .outputs - .iter() - .filter(|o| !state.outputs.contains(o)) - { - for wl_output in old_output.client_outputs(&client) { - instance.output_leave(&wl_output); - } - changed = true; - } - handle_state.outputs = state.outputs.clone(); - } - - if let Some(workspace_state) = workspace_state { - for new_workspace in state - .workspaces - .iter() - .filter(|w| !handle_state.workspaces.contains(w)) - { - if let Some(handle) = - workspace_state.raw_workspace_handle(&new_workspace, &instance.id()) - { - instance.workspace_enter(&handle); - changed = true; - } - } - for old_workspace in handle_state - .workspaces - .iter() - .filter(|w| !state.workspaces.contains(w)) - { - if let Some(handle) = - workspace_state.raw_workspace_handle(&old_workspace, &instance.id()) - { - instance.workspace_leave(&handle); - changed = true; - } - } - handle_state.workspaces = state.workspaces.clone(); - } - - if changed { - instance.done(); - } -} - -pub fn window_from_handle(handle: ZcosmicToplevelHandleV1) -> Option { - handle - .data::() - .map(|state| state.lock().unwrap().window.clone()) -} - -#[macro_export] -macro_rules! delegate_toplevel_info { - ($(@<$( $lt:tt $( : $clt:tt $(+ $dlt:tt )* )? ),+>)? $ty: ty) => { - smithay::reexports::wayland_server::delegate_global_dispatch!($(@< $( $lt $( : $clt $(+ $dlt )* )? ),+ >)? $ty: [ - cosmic_protocols::toplevel_info::v1::server::zcosmic_toplevel_info_v1::ZcosmicToplevelInfoV1: $crate::toplevel_info::ToplevelInfoGlobalData - ] => $crate::toplevel_info::ToplevelInfoState); - smithay::reexports::wayland_server::delegate_dispatch!($(@< $( $lt $( : $clt $(+ $dlt )* )? ),+ >)? $ty: [ - cosmic_protocols::toplevel_info::v1::server::zcosmic_toplevel_info_v1::ZcosmicToplevelInfoV1: () - ] => $crate::toplevel_info::ToplevelInfoState); - smithay::reexports::wayland_server::delegate_dispatch!($(@< $( $lt $( : $clt $(+ $dlt )* )? ),+ >)? $ty: [ - cosmic_protocols::toplevel_info::v1::server::zcosmic_toplevel_handle_v1::ZcosmicToplevelHandleV1: $crate::toplevel_info::ToplevelHandleState - ] => $crate::toplevel_info::ToplevelInfoState); - }; -} -pub use delegate_toplevel_info; diff --git a/cosmic-panel-bin/src/xdg_shell_wrapper/protocols/toplevel_management.rs b/cosmic-panel-bin/src/xdg_shell_wrapper/protocols/toplevel_management.rs deleted file mode 100644 index abe3717..0000000 --- a/cosmic-panel-bin/src/xdg_shell_wrapper/protocols/toplevel_management.rs +++ /dev/null @@ -1,231 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 - -use smithay::{ - desktop::Window, - input::{Seat, SeatHandler}, - output::Output, - reexports::wayland_server::{ - backend::{ClientId, GlobalId, ObjectId}, - protocol::wl_surface::WlSurface, - Client, DataInit, Dispatch, DisplayHandle, GlobalDispatch, New, Resource, - }, - utils::{Logical, Rectangle}, -}; - -pub use cosmic_protocols::toplevel_management::v1::server::zcosmic_toplevel_manager_v1::ZcosmicToplelevelManagementCapabilitiesV1 as ManagementCapabilities; -use cosmic_protocols::toplevel_management::v1::server::zcosmic_toplevel_manager_v1::{ - self, ZcosmicToplevelManagerV1, -}; - -use super::toplevel_info::{window_from_handle, ToplevelInfoHandler, ToplevelState}; - -pub struct ToplevelManagementState { - instances: Vec, - capabilities: Vec, - global: GlobalId, -} - -#[allow(unused_variables)] -pub trait ToplevelManagementHandler: ToplevelInfoHandler + SeatHandler { - fn toplevel_management_state(&mut self) -> &mut ToplevelManagementState; - fn activate(&mut self, dh: &DisplayHandle, window: &Window, seat: Option>) {} - fn close(&mut self, dh: &DisplayHandle, window: &Window) {} - fn fullscreen(&mut self, dh: &DisplayHandle, window: &Window, output: Option) {} - fn unfullscreen(&mut self, dh: &DisplayHandle, window: &Window) {} - fn maximize(&mut self, dh: &DisplayHandle, window: &Window) {} - fn unmaximize(&mut self, dh: &DisplayHandle, window: &Window) {} - fn minimize(&mut self, dh: &DisplayHandle, window: &Window) {} - fn unminimize(&mut self, dh: &DisplayHandle, window: &Window) {} -} - -pub struct ToplevelManagerGlobalData { - filter: Box Fn(&'a Client) -> bool + Send + Sync>, -} - -impl ToplevelManagementState { - pub fn new( - dh: &DisplayHandle, - capabilities: Vec, - client_filter: F, - ) -> ToplevelManagementState - where - D: GlobalDispatch - + Dispatch - + ToplevelManagementHandler - + 'static, - F: for<'a> Fn(&'a Client) -> bool + Send + Sync + 'static, - { - let global = dh.create_global::( - 1, - ToplevelManagerGlobalData { - filter: Box::new(client_filter), - }, - ); - ToplevelManagementState { - capabilities, - instances: Vec::new(), - global, - } - } - - pub fn rectangle_for( - &mut self, - window: &Window, - client: &ClientId, - ) -> Option<(WlSurface, Rectangle)> { - if let Some(state) = window.user_data().get::() { - state.lock().unwrap().rectangles.get(client).cloned() - } else { - None - } - } - - pub fn global_id(&self) -> GlobalId { - self.global.clone() - } -} - -impl GlobalDispatch - for ToplevelManagementState -where - D: GlobalDispatch - + Dispatch - + ToplevelManagementHandler - + 'static, -{ - fn bind( - state: &mut D, - _dh: &DisplayHandle, - _client: &Client, - resource: New, - _global_data: &ToplevelManagerGlobalData, - data_init: &mut DataInit<'_, D>, - ) { - let instance = data_init.init(resource, ()); - let capabilities = { - let mut caps = state.toplevel_management_state().capabilities.clone(); - let ratio = std::mem::size_of::() / std::mem::size_of::(); - let ptr = caps.as_mut_ptr() as *mut u8; - let len = caps.len() * ratio; - let cap = caps.capacity() * ratio; - std::mem::forget(caps); - unsafe { Vec::from_raw_parts(ptr, len, cap) } - }; - instance.capabilities(capabilities); - state.toplevel_management_state().instances.push(instance); - } - - fn can_view(client: Client, global_data: &ToplevelManagerGlobalData) -> bool { - (global_data.filter)(&client) - } -} - -impl Dispatch for ToplevelManagementState -where - D: GlobalDispatch - + Dispatch - + ToplevelManagementHandler - + 'static, -{ - fn request( - state: &mut D, - _client: &Client, - _obj: &ZcosmicToplevelManagerV1, - request: zcosmic_toplevel_manager_v1::Request, - _data: &(), - dh: &DisplayHandle, - _data_init: &mut DataInit<'_, D>, - ) { - match request { - zcosmic_toplevel_manager_v1::Request::Activate { toplevel, seat } => { - let window = window_from_handle(toplevel).unwrap(); - state.activate(dh, &window, Seat::from_resource(&seat)); - } - zcosmic_toplevel_manager_v1::Request::Close { toplevel } => { - let window = window_from_handle(toplevel).unwrap(); - state.close(dh, &window); - } - zcosmic_toplevel_manager_v1::Request::SetFullscreen { toplevel, output } => { - let window = window_from_handle(toplevel).unwrap(); - state.fullscreen(dh, &window, output.as_ref().and_then(Output::from_resource)) - } - zcosmic_toplevel_manager_v1::Request::UnsetFullscreen { toplevel } => { - let window = window_from_handle(toplevel).unwrap(); - state.unfullscreen(dh, &window); - } - zcosmic_toplevel_manager_v1::Request::SetMaximized { toplevel } => { - let window = window_from_handle(toplevel).unwrap(); - state.maximize(dh, &window); - } - zcosmic_toplevel_manager_v1::Request::UnsetMaximized { toplevel } => { - let window = window_from_handle(toplevel).unwrap(); - state.unmaximize(dh, &window); - } - zcosmic_toplevel_manager_v1::Request::SetMinimized { toplevel } => { - let window = window_from_handle(toplevel).unwrap(); - state.minimize(dh, &window); - } - zcosmic_toplevel_manager_v1::Request::UnsetMinimized { toplevel } => { - let window = window_from_handle(toplevel).unwrap(); - state.unminimize(dh, &window); - } - zcosmic_toplevel_manager_v1::Request::SetRectangle { - toplevel, - surface, - x, - y, - width, - height, - } => { - let window = window_from_handle(toplevel).unwrap(); - if let Some(toplevel_state) = window.user_data().get::() { - let mut toplevel_state = toplevel_state.lock().unwrap(); - if let Some(client) = surface.client() { - if width == 0 && height == 0 { - toplevel_state.rectangles.remove(&client.id()); - } else { - toplevel_state.rectangles.insert( - client.id(), - ( - surface, - Rectangle::from_loc_and_size((x, y), (width, height)), - ), - ); - } - } - } - } - _ => unreachable!(), - } - } - - fn destroyed(state: &mut D, client: ClientId, resource: ObjectId, _data: &()) { - let mng_state = state.toplevel_management_state(); - mng_state.instances.retain(|i| i.id() != resource); - if !mng_state - .instances - .iter() - .any(|i| i.client().map(|c| c.id() == client).unwrap_or(false)) - { - for toplevel in state.toplevel_info_state_mut().toplevels.iter() { - if let Some(toplevel_state) = toplevel.user_data().get::() { - toplevel_state.lock().unwrap().rectangles.remove(&client); - } - } - } - } -} - -#[macro_export] -macro_rules! delegate_toplevel_management { - ($(@<$( $lt:tt $( : $clt:tt $(+ $dlt:tt )* )? ),+>)? $ty: ty) => { - smithay::reexports::wayland_server::delegate_global_dispatch!($(@< $( $lt $( : $clt $(+ $dlt )* )? ),+ >)? $ty: [ - cosmic_protocols::toplevel_management::v1::server::zcosmic_toplevel_manager_v1::ZcosmicToplevelManagerV1: $crate::toplevel_management::ToplevelManagerGlobalData - ] => $crate::toplevel_management::ToplevelManagementState); - smithay::reexports::wayland_server::delegate_dispatch!($(@< $( $lt $( : $clt $(+ $dlt )* )? ),+ >)? $ty: [ - cosmic_protocols::toplevel_management::v1::server::zcosmic_toplevel_manager_v1::ZcosmicToplevelManagerV1: () - ] => $crate::toplevel_management::ToplevelManagementState); - }; -} - -pub use delegate_toplevel_management; diff --git a/cosmic-panel-bin/src/xdg_shell_wrapper/protocols/workspace.rs b/cosmic-panel-bin/src/xdg_shell_wrapper/protocols/workspace.rs deleted file mode 100644 index 36403b9..0000000 --- a/cosmic-panel-bin/src/xdg_shell_wrapper/protocols/workspace.rs +++ /dev/null @@ -1,969 +0,0 @@ -// SPDX-License-Identifier: MPL-2.0 - -use std::{collections::HashSet, sync::Mutex}; - -use smithay::{ - output::Output, - reexports::wayland_server::{ - backend::{ClientData, ClientId, GlobalId, ObjectId}, - Client, DataInit, Dispatch, DisplayHandle, GlobalDispatch, New, Resource, - }, -}; - -use cosmic_protocols::workspace::v1::server::{ - zcosmic_workspace_group_handle_v1::{self, ZcosmicWorkspaceGroupHandleV1}, - zcosmic_workspace_handle_v1::{self, ZcosmicWorkspaceHandleV1}, - zcosmic_workspace_manager_v1::{self, ZcosmicWorkspaceManagerV1}, -}; - -pub use cosmic_protocols::workspace::v1::server::{ - zcosmic_workspace_group_handle_v1::ZcosmicWorkspaceGroupCapabilitiesV1 as GroupCapabilities, - zcosmic_workspace_handle_v1::ZcosmicWorkspaceCapabilitiesV1 as WorkspaceCapabilities, -}; - -pub struct WorkspaceState -where - D: GlobalDispatch - + Dispatch - + Dispatch - + Dispatch - + WorkspaceHandler - + 'static, - ::Client: ClientData + WorkspaceClientHandler + 'static, -{ - dh: DisplayHandle, - global: GlobalId, - instances: Vec, - groups: Vec, - _marker: std::marker::PhantomData, -} -pub struct WorkspaceUpdateGuard<'a, D>(&'a mut WorkspaceState) -where - D: GlobalDispatch - + Dispatch - + Dispatch - + Dispatch - + WorkspaceHandler - + 'static, - ::Client: ClientData + WorkspaceClientHandler + 'static; - -#[derive(Default)] -pub struct WorkspaceGroup { - id: usize, - instances: Vec, - workspaces: Vec, - - outputs: Vec, - capabilities: Vec, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub struct WorkspaceGroupHandle { - id: usize, -} - -#[derive(Default)] -pub struct WorkspaceGroupDataInner { - outputs: Vec, - capabilities: Vec, -} -pub type WorkspaceGroupData = Mutex; - -#[derive(Default)] -pub struct Workspace { - id: usize, - instances: Vec, - - name: String, - capabilities: Vec, - coordinates: Vec, - states: HashSet, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub struct WorkspaceHandle { - id: usize, -} - -#[derive(Default)] -pub struct WorkspaceDataInner { - name: String, - capabilities: Vec, - coordinates: Vec, - states: HashSet, -} -pub type WorkspaceData = Mutex; - -pub trait WorkspaceHandler -where - Self: GlobalDispatch - + Dispatch - + Dispatch - + Dispatch - + Sized - + 'static, -{ - type Client: ClientData + WorkspaceClientHandler + 'static; - - fn workspace_state(&self) -> &WorkspaceState; - fn workspace_state_mut(&mut self) -> &mut WorkspaceState; - fn commit_requests(&mut self, dh: &DisplayHandle, requests: Vec); -} - -pub struct WorkspaceGlobalData { - filter: Box Fn(&'a Client) -> bool + Send + Sync>, -} - -#[derive(Debug)] -pub enum Request { - Activate(WorkspaceHandle), - Deactivate(WorkspaceHandle), - Remove(WorkspaceHandle), - Create { - in_group: WorkspaceGroupHandle, - name: String, - }, -} - -#[derive(Debug, Default)] -pub struct WorkspaceClientStateInner { - requests: Vec, -} -pub type WorkspaceClientState = Mutex; - -pub trait WorkspaceClientHandler { - fn workspace_state(&self) -> &WorkspaceClientState; -} - -impl GlobalDispatch for WorkspaceState -where - D: GlobalDispatch - + Dispatch - + Dispatch - + Dispatch - + WorkspaceHandler - + 'static, - ::Client: ClientData + WorkspaceClientHandler + 'static, -{ - fn bind( - state: &mut D, - dh: &DisplayHandle, - _client: &Client, - resource: New, - _global_data: &WorkspaceGlobalData, - data_init: &mut DataInit<'_, D>, - ) { - let state = state.workspace_state_mut(); - let instance = data_init.init(resource, ()); - for group in &mut state.groups { - send_group_to_client::(dh, &instance, group); - instance.done(); - } - state.instances.push(instance); - } - - fn can_view(client: Client, global_data: &WorkspaceGlobalData) -> bool { - (global_data.filter)(&client) - } -} - -impl Dispatch for WorkspaceState -where - D: GlobalDispatch - + Dispatch - + Dispatch - + Dispatch - + WorkspaceHandler - + 'static, - ::Client: ClientData + WorkspaceClientHandler + 'static, -{ - fn request( - state: &mut D, - client: &Client, - obj: &ZcosmicWorkspaceManagerV1, - request: zcosmic_workspace_manager_v1::Request, - _data: &(), - dh: &DisplayHandle, - _data_init: &mut DataInit<'_, D>, - ) { - match request { - zcosmic_workspace_manager_v1::Request::Commit => { - if state.workspace_state().instances.contains(obj) { - let mut client_state = client - .get_data::<::Client>() - .unwrap() - .workspace_state() - .lock() - .unwrap(); - state.commit_requests(dh, std::mem::take(&mut client_state.requests)); - } - } - zcosmic_workspace_manager_v1::Request::Stop => { - state.workspace_state_mut().instances.retain(|i| i != obj); - // without an instance, the whole send_group_to_client machinery doesn't work - // so there is no way for the whole clients hierachy to get any new events - } - _ => {} - } - } - - fn destroyed(state: &mut D, _client: ClientId, resource: ObjectId, _data: &()) { - state - .workspace_state_mut() - .instances - .retain(|i| i.id() != resource); - } -} - -impl Dispatch for WorkspaceState -where - D: GlobalDispatch - + Dispatch - + Dispatch - + Dispatch - + WorkspaceHandler - + 'static, - ::Client: ClientData + WorkspaceClientHandler + 'static, -{ - fn request( - state: &mut D, - client: &Client, - obj: &ZcosmicWorkspaceGroupHandleV1, - request: zcosmic_workspace_group_handle_v1::Request, - _data: &WorkspaceGroupData, - _dh: &DisplayHandle, - _data_init: &mut DataInit<'_, D>, - ) { - match request { - zcosmic_workspace_group_handle_v1::Request::CreateWorkspace { workspace } => { - if let Some(id) = state - .workspace_state() - .groups - .iter() - .find(|g| g.instances.contains(obj)) - .map(|g| g.id) - { - let mut state = client - .get_data::<::Client>() - .unwrap() - .workspace_state() - .lock() - .unwrap(); - state.requests.push(Request::Create { - in_group: WorkspaceGroupHandle { id }, - name: workspace, - }); - } - } - zcosmic_workspace_group_handle_v1::Request::Destroy => { - for group in &mut state.workspace_state_mut().groups { - group.instances.retain(|i| i != obj) - } - } - _ => {} - } - } - - fn destroyed(state: &mut D, _client: ClientId, resource: ObjectId, _data: &WorkspaceGroupData) { - for group in &mut state.workspace_state_mut().groups { - group.instances.retain(|i| i.id() != resource) - } - } -} - -impl Dispatch for WorkspaceState -where - D: GlobalDispatch - + Dispatch - + Dispatch - + Dispatch - + WorkspaceHandler - + 'static, - ::Client: ClientData + WorkspaceClientHandler + 'static, -{ - fn request( - state: &mut D, - client: &Client, - obj: &ZcosmicWorkspaceHandleV1, - request: zcosmic_workspace_handle_v1::Request, - _data: &WorkspaceData, - _dh: &DisplayHandle, - _data_init: &mut DataInit<'_, D>, - ) { - match request { - zcosmic_workspace_handle_v1::Request::Activate => { - if let Some(id) = state - .workspace_state() - .groups - .iter() - .find_map(|g| g.workspaces.iter().find(|w| w.instances.contains(obj))) - .map(|w| w.id) - { - let mut state = client - .get_data::<::Client>() - .unwrap() - .workspace_state() - .lock() - .unwrap(); - state - .requests - .push(Request::Activate(WorkspaceHandle { id })); - } - } - zcosmic_workspace_handle_v1::Request::Deactivate => { - if let Some(id) = state - .workspace_state() - .groups - .iter() - .find_map(|g| g.workspaces.iter().find(|w| w.instances.contains(obj))) - .map(|w| w.id) - { - let mut state = client - .get_data::<::Client>() - .unwrap() - .workspace_state() - .lock() - .unwrap(); - state - .requests - .push(Request::Deactivate(WorkspaceHandle { id })); - } - } - zcosmic_workspace_handle_v1::Request::Remove => { - if let Some(id) = state - .workspace_state() - .groups - .iter() - .find_map(|g| g.workspaces.iter().find(|w| w.instances.contains(obj))) - .map(|w| w.id) - { - let mut state = client - .get_data::<::Client>() - .unwrap() - .workspace_state() - .lock() - .unwrap(); - state.requests.push(Request::Remove(WorkspaceHandle { id })); - } - } - zcosmic_workspace_handle_v1::Request::Destroy => { - for group in &mut state.workspace_state_mut().groups { - for workspace in &mut group.workspaces { - workspace.instances.retain(|i| i != obj) - } - } - } - _ => {} - } - } - - fn destroyed(state: &mut D, _client: ClientId, resource: ObjectId, _data: &WorkspaceData) { - for group in &mut state.workspace_state_mut().groups { - for workspace in &mut group.workspaces { - workspace.instances.retain(|i| i.id() != resource) - } - } - } -} - -impl WorkspaceState -where - D: GlobalDispatch - + Dispatch - + Dispatch - + Dispatch - + WorkspaceHandler - + 'static, - ::Client: ClientData + WorkspaceClientHandler + 'static, -{ - pub fn new(dh: &DisplayHandle, client_filter: F) -> WorkspaceState - where - F: for<'a> Fn(&'a Client) -> bool + Send + Sync + 'static, - { - let global = dh.create_global::( - 1, - WorkspaceGlobalData { - filter: Box::new(client_filter), - }, - ); - - WorkspaceState { - dh: dh.clone(), - global, - instances: Vec::new(), - groups: Vec::new(), - _marker: std::marker::PhantomData, - } - } - - pub fn workspace_belongs_to_group( - &self, - group: &WorkspaceGroupHandle, - workspace: &WorkspaceHandle, - ) -> bool { - if let Some(group) = self.groups.iter().find(|g| g.id == group.id) { - group.workspaces.iter().any(|w| w.id == workspace.id) - } else { - false - } - } - - pub fn group_capabilities( - &self, - group: &WorkspaceGroupHandle, - ) -> Option> { - self.groups - .iter() - .find(|g| g.id == group.id) - .map(|g| g.capabilities.iter()) - } - - pub fn group_outputs( - &self, - group: &WorkspaceGroupHandle, - ) -> Option> { - self.groups - .iter() - .find(|g| g.id == group.id) - .map(|g| g.outputs.iter()) - } - - pub fn workspace_capabilities( - &self, - workspace: &WorkspaceHandle, - ) -> Option> { - self.groups.iter().find_map(|g| { - g.workspaces - .iter() - .find(|w| w.id == workspace.id) - .map(|w| w.capabilities.iter()) - }) - } - - pub fn workspace_name(&self, workspace: &WorkspaceHandle) -> Option<&str> { - self.groups.iter().find_map(|g| { - g.workspaces - .iter() - .find(|w| w.id == workspace.id) - .map(|w| &*w.name) - }) - } - - pub fn workspace_coordinates(&self, workspace: &WorkspaceHandle) -> Option<&[u32]> { - self.groups.iter().find_map(|g| { - g.workspaces - .iter() - .find(|w| w.id == workspace.id) - .map(|w| &*w.coordinates) - }) - } - - pub fn workspace_states( - &self, - workspace: &WorkspaceHandle, - ) -> Option> { - self.groups.iter().find_map(|g| { - g.workspaces - .iter() - .find(|w| w.id == workspace.id) - .map(|w| w.states.iter()) - }) - } - - pub fn group_handle( - &self, - group: &ZcosmicWorkspaceGroupHandleV1, - ) -> Option { - self.groups - .iter() - .find(|g| g.instances.contains(group)) - .map(|g| WorkspaceGroupHandle { id: g.id }) - } - pub fn workspace_handle( - &self, - workspace: &ZcosmicWorkspaceHandleV1, - ) -> Option { - self.groups - .iter() - .find_map(|g| { - g.workspaces - .iter() - .find(|w| w.instances.contains(workspace)) - }) - .map(|w| WorkspaceHandle { id: w.id }) - } - - pub fn raw_group_handle( - &self, - group: &WorkspaceGroupHandle, - client: &ObjectId, - ) -> Option { - self.groups - .iter() - .find(|g| g.id == group.id) - .and_then(|g| g.instances.iter().find(|i| i.id().same_client_as(client))) - .cloned() - } - pub fn raw_workspace_handle( - &self, - workspace: &WorkspaceHandle, - client: &ObjectId, - ) -> Option { - self.groups - .iter() - .find_map(|g| g.workspaces.iter().find(|w| w.id == workspace.id)) - .and_then(|w| w.instances.iter().find(|i| i.id().same_client_as(client))) - .cloned() - } - - pub fn update<'a>(&'a mut self) -> WorkspaceUpdateGuard<'a, D> { - WorkspaceUpdateGuard(self) - } - - fn done(&mut self) { - let mut changed = false; - for instance in &self.instances { - for mut group in &mut self.groups { - if send_group_to_client::(&self.dh, instance, &mut group) { - changed = true; - } - } - } - if changed { - for instance in &self.instances { - instance.done(); - } - } - } - - pub fn global_id(&self) -> GlobalId { - self.global.clone() - } -} - -impl<'a, D> WorkspaceUpdateGuard<'a, D> -where - D: GlobalDispatch - + Dispatch - + Dispatch - + Dispatch - + WorkspaceHandler - + 'static, - ::Client: ClientData + WorkspaceClientHandler + 'static, -{ - pub fn create_workspace_group(&mut self, id: usize) -> WorkspaceGroupHandle { - WorkspaceGroupHandle { id } - } - - pub fn create_workspace( - &mut self, - group: &WorkspaceGroupHandle, - id: usize, - ) -> Option { - if let Some(group) = self.0.groups.iter_mut().find(|g| g.id == group.id) { - let workspace = Workspace { - id, - ..Default::default() - }; - group.workspaces.push(workspace); - Some(WorkspaceHandle { id }) - } else { - None - } - } - - pub fn remove_workspace_group(&mut self, group: WorkspaceGroupHandle) { - // "The compositor must remove all workspaces belonging to a workspace group before removing the workspace group." - for workspace in self - .0 - .groups - .iter() - .filter(|g| g.id == group.id) - .flat_map(|g| g.workspaces.iter().map(|w| WorkspaceHandle { id: w.id })) - .collect::>() - .into_iter() - { - self.remove_workspace(workspace); - } - - if let Some(group) = self.0.groups.iter().find(|g| g.id == group.id) { - for instance in &group.instances { - instance.remove() - } - } - self.0.groups.retain(|g| g.id != group.id); - } - - pub fn remove_workspace(&mut self, workspace: WorkspaceHandle) { - for group in &mut self.0.groups { - if let Some(workspace) = group.workspaces.iter().find(|w| w.id == workspace.id) { - for instance in &workspace.instances { - instance.remove(); - } - } - group.workspaces.retain(|w| w.id != workspace.id); - } - } - - pub fn workspace_belongs_to_group( - &self, - group: &WorkspaceGroupHandle, - workspace: &WorkspaceHandle, - ) -> bool { - self.0.workspace_belongs_to_group(group, workspace) - } - - pub fn group_capabilities( - &mut self, - group: &WorkspaceGroupHandle, - ) -> Option> { - self.0.group_capabilities(group) - } - - pub fn set_group_capabilities( - &mut self, - group: &WorkspaceGroupHandle, - capabilities: impl Iterator, - ) { - if let Some(group) = self.0.groups.iter_mut().find(|g| g.id == group.id) { - group.capabilities = capabilities.collect(); - } - } - - pub fn group_outputs( - &self, - group: &WorkspaceGroupHandle, - ) -> Option> { - self.0.group_outputs(group) - } - - pub fn add_group_output(&mut self, group: &WorkspaceGroupHandle, output: &Output) { - if let Some(group) = self.0.groups.iter_mut().find(|g| g.id == group.id) { - group.outputs.push(output.clone()) - } - } - - pub fn remove_group_output(&mut self, group: &WorkspaceGroupHandle, output: &Output) { - if let Some(group) = self.0.groups.iter_mut().find(|g| g.id == group.id) { - group.outputs.retain(|o| o != output) - } - } - - pub fn workspace_capabilities( - &self, - workspace: &WorkspaceHandle, - ) -> Option> { - self.0.workspace_capabilities(workspace) - } - - pub fn set_workspace_capabilities( - &mut self, - workspace: &WorkspaceHandle, - capabilities: impl Iterator, - ) { - if let Some(workspace) = self - .0 - .groups - .iter_mut() - .find_map(|g| g.workspaces.iter_mut().find(|w| w.id == workspace.id)) - { - workspace.capabilities = capabilities.collect(); - } - } - - pub fn workspace_name(&self, workspace: &WorkspaceHandle) -> Option<&str> { - self.0.workspace_name(workspace) - } - - pub fn set_workspace_name(&mut self, workspace: &WorkspaceHandle, name: impl Into) { - if let Some(workspace) = self - .0 - .groups - .iter_mut() - .find_map(|g| g.workspaces.iter_mut().find(|w| w.id == workspace.id)) - { - workspace.name = name.into(); - } - } - - pub fn workspace_coordinates(&self, workspace: &WorkspaceHandle) -> Option<&[u32]> { - self.0.workspace_coordinates(workspace) - } - - pub fn set_workspace_coordinates( - &mut self, - workspace: &WorkspaceHandle, - coords: [Option; 3], - ) { - if let Some(workspace) = self - .0 - .groups - .iter_mut() - .find_map(|g| g.workspaces.iter_mut().find(|w| w.id == workspace.id)) - { - workspace.coordinates = coords - .iter() - .flat_map(std::convert::identity) - .copied() - .collect(); - } - } - - pub fn workspace_states( - &self, - workspace: &WorkspaceHandle, - ) -> Option> { - self.0.workspace_states(workspace) - } - - pub fn add_workspace_state( - &mut self, - workspace: &WorkspaceHandle, - state: zcosmic_workspace_handle_v1::State, - ) { - if let Some(workspace) = self - .0 - .groups - .iter_mut() - .find_map(|g| g.workspaces.iter_mut().find(|w| w.id == workspace.id)) - { - workspace.states.insert(state); - } - } - - pub fn remove_workspace_state( - &mut self, - workspace: &WorkspaceHandle, - state: zcosmic_workspace_handle_v1::State, - ) { - if let Some(workspace) = self - .0 - .groups - .iter_mut() - .find_map(|g| g.workspaces.iter_mut().find(|w| w.id == workspace.id)) - { - workspace.states.remove(&state); - } - } -} - -impl<'a, D> Drop for WorkspaceUpdateGuard<'a, D> -where - D: GlobalDispatch - + Dispatch - + Dispatch - + Dispatch - + WorkspaceHandler - + 'static, - ::Client: ClientData + WorkspaceClientHandler + 'static, -{ - fn drop(&mut self) { - self.0.done(); - } -} - -fn send_group_to_client( - dh: &DisplayHandle, - mngr: &ZcosmicWorkspaceManagerV1, - group: &mut WorkspaceGroup, -) -> bool -where - D: GlobalDispatch - + Dispatch - + Dispatch - + Dispatch - + WorkspaceHandler - + 'static, - ::Client: ClientData + WorkspaceClientHandler + 'static, -{ - let instance = match group - .instances - .iter_mut() - .find(|i| i.id().same_client_as(&mngr.id())) - { - Some(i) => i, - None => { - if let Ok(client) = dh.get_client(mngr.id()) { - if let Ok(handle) = client.create_resource::( - dh, - mngr.version(), - WorkspaceGroupData::default(), - ) { - mngr.workspace_group(&handle); - group.instances.push(handle); - group.instances.last_mut().unwrap() - } else { - return false; - } - } else { - return false; - } - } - }; - - let mut handle_state = instance - .data::() - .unwrap() - .lock() - .unwrap(); - let mut changed = false; - if let Ok(client) = dh.get_client(instance.id()) { - for new_output in group - .outputs - .iter() - .filter(|o| !handle_state.outputs.contains(o)) - { - for wl_output in new_output.client_outputs(&client) { - instance.output_enter(&wl_output); - } - changed = true; - } - for old_output in handle_state - .outputs - .iter() - .filter(|o| !group.outputs.contains(o)) - { - for wl_output in old_output.client_outputs(&client) { - instance.output_leave(&wl_output); - } - changed = true; - } - handle_state.outputs = group.outputs.clone(); - } - - if handle_state.capabilities != group.capabilities { - let caps: Vec = { - let mut caps = group.capabilities.clone(); - let ratio = std::mem::size_of::() / std::mem::size_of::(); - let ptr = caps.as_mut_ptr() as *mut u8; - let len = caps.len() * ratio; - let cap = caps.capacity() * ratio; - std::mem::forget(caps); - unsafe { Vec::from_raw_parts(ptr, len, cap) } - }; - instance.capabilities(caps); - handle_state.capabilities = group.capabilities.clone(); - changed = true; - } - - for workspace in &mut group.workspaces { - if send_workspace_to_client::(dh, instance, workspace) { - changed = true; - } - } - - changed -} - -fn send_workspace_to_client( - dh: &DisplayHandle, - group: &ZcosmicWorkspaceGroupHandleV1, - workspace: &mut Workspace, -) -> bool -where - D: GlobalDispatch - + Dispatch - + Dispatch - + Dispatch - + WorkspaceHandler - + 'static, - ::Client: ClientData + WorkspaceClientHandler + 'static, -{ - let instance = match workspace - .instances - .iter_mut() - .find(|i| i.id().same_client_as(&group.id())) - { - Some(i) => i, - None => { - if let Ok(client) = dh.get_client(group.id()) { - if let Ok(handle) = client.create_resource::( - dh, - group.version(), - WorkspaceData::default(), - ) { - group.workspace(&handle); - workspace.instances.push(handle); - workspace.instances.last_mut().unwrap() - } else { - return false; - } - } else { - return false; - } - } - }; - - let mut handle_state = instance.data::().unwrap().lock().unwrap(); - let mut changed = false; - - if handle_state.name != workspace.name { - instance.name(workspace.name.clone()); - handle_state.name = workspace.name.clone(); - changed = true; - } - if handle_state.coordinates != workspace.coordinates { - let coords: Vec = { - let mut coords = workspace.coordinates.clone(); - let ratio = std::mem::size_of::() / std::mem::size_of::(); - let ptr = coords.as_mut_ptr() as *mut u8; - let len = coords.len() * ratio; - let cap = coords.capacity() * ratio; - std::mem::forget(coords); - unsafe { Vec::from_raw_parts(ptr, len, cap) } - }; - instance.coordinates(coords); - handle_state.coordinates = workspace.coordinates.clone(); - changed = true; - } - if handle_state.capabilities != workspace.capabilities { - let caps: Vec = { - let mut caps = workspace.capabilities.clone(); - let ratio = std::mem::size_of::() / std::mem::size_of::(); - let ptr = caps.as_mut_ptr() as *mut u8; - let len = caps.len() * ratio; - let cap = caps.capacity() * ratio; - std::mem::forget(caps); - unsafe { Vec::from_raw_parts(ptr, len, cap) } - }; - instance.capabilities(caps); - handle_state.capabilities = workspace.capabilities.clone(); - changed = true; - } - if handle_state.states != workspace.states { - let states: Vec = { - let mut states = workspace.states.iter().cloned().collect::>(); - let ratio = std::mem::size_of::() - / std::mem::size_of::(); - let ptr = states.as_mut_ptr() as *mut u8; - let len = states.len() * ratio; - let cap = states.capacity() * ratio; - std::mem::forget(states); - unsafe { Vec::from_raw_parts(ptr, len, cap) } - }; - instance.state(states); - handle_state.states = workspace.states.clone(); - changed = true; - } - - changed -} - -#[macro_export] -macro_rules! delegate_workspace { - ($(@<$( $lt:tt $( : $clt:tt $(+ $dlt:tt )* )? ),+>)? $ty: ty) => { - smithay::reexports::wayland_server::delegate_global_dispatch!($(@< $( $lt $( : $clt $(+ $dlt )* )? ),+ >)? $ty: [ - cosmic_protocols::workspace::v1::server::zcosmic_workspace_manager_v1::ZcosmicWorkspaceManagerV1: $crate::workspace::WorkspaceGlobalData - ] => $crate::workspace::WorkspaceState); - smithay::reexports::wayland_server::delegate_dispatch!($(@< $( $lt $( : $clt $(+ $dlt )* )? ),+ >)? $ty: [ - cosmic_protocols::workspace::v1::server::zcosmic_workspace_manager_v1::ZcosmicWorkspaceManagerV1: () - ] => $crate::workspace::WorkspaceState); - smithay::reexports::wayland_server::delegate_dispatch!($(@< $( $lt $( : $clt $(+ $dlt )* )? ),+ >)? $ty: [ - cosmic_protocols::workspace::v1::server::zcosmic_workspace_group_handle_v1::ZcosmicWorkspaceGroupHandleV1: $crate::workspace::WorkspaceGroupData - ] => $crate::workspace::WorkspaceState); - smithay::reexports::wayland_server::delegate_dispatch!($(@< $( $lt $( : $clt $(+ $dlt )* )? ),+ >)? $ty: [ - cosmic_protocols::workspace::v1::server::zcosmic_workspace_handle_v1::ZcosmicWorkspaceHandleV1: $crate::workspace::WorkspaceData - ] => $crate::workspace::WorkspaceState); - }; -} -pub use delegate_workspace; diff --git a/cosmic-panel-bin/src/xdg_shell_wrapper/server/handlers/mod.rs b/cosmic-panel-bin/src/xdg_shell_wrapper/server/handlers/mod.rs index 2a7f2a2..d5be8b0 100644 --- a/cosmic-panel-bin/src/xdg_shell_wrapper/server/handlers/mod.rs +++ b/cosmic-panel-bin/src/xdg_shell_wrapper/server/handlers/mod.rs @@ -1,15 +1,12 @@ -use std::{cell::RefMut, os::fd::OwnedFd, rc::Rc, sync::Mutex}; +use std::{os::fd::OwnedFd, sync::Mutex}; use itertools::Itertools; use sctk::{ data_device_manager::data_offer::receive_to_fd, - reexports::client::{protocol::wl_data_device_manager::DndAction as ClientDndAction, Proxy}, + reexports::client::protocol::wl_data_device_manager::DndAction as ClientDndAction, }; use smithay::{ - backend::{ - egl::EGLSurface, - renderer::{damage::OutputDamageTracker, ImportDma}, - }, + backend::renderer::{damage::OutputDamageTracker, ImportDma}, delegate_data_device, delegate_dmabuf, delegate_output, delegate_primary_selection, delegate_seat, input::{pointer::CursorImageAttributes, Seat, SeatHandler, SeatState}, diff --git a/cosmic-panel-bin/src/xdg_shell_wrapper/space/space.rs b/cosmic-panel-bin/src/xdg_shell_wrapper/space/space.rs index 2d43f46..e29c2d0 100644 --- a/cosmic-panel-bin/src/xdg_shell_wrapper/space/space.rs +++ b/cosmic-panel-bin/src/xdg_shell_wrapper/space/space.rs @@ -33,7 +33,8 @@ use crate::{ iced::elements::target::SpaceTarget, xdg_shell_wrapper::{ client::handlers::{ - wp_fractional_scaling::FractionalScalingManager, wp_viewporter::ViewporterState, + overlap::OverlapNotifyV1, wp_fractional_scaling::FractionalScalingManager, + wp_viewporter::ViewporterState, }, client_state::ClientFocus, config::WrapperConfig, @@ -121,6 +122,7 @@ pub trait WrapperSpace { layer_state: &mut LayerShell, conn: &Connection, qh: &QueueHandle, + overlap_notify: Option, ); /// add the configured output to the space diff --git a/cosmic-panel-config/src/container_config.rs b/cosmic-panel-config/src/container_config.rs index f2a4442..3b3cef1 100644 --- a/cosmic-panel-config/src/container_config.rs +++ b/cosmic-panel-config/src/container_config.rs @@ -192,6 +192,7 @@ impl Default for CosmicPanelContainerConfig { wait_time: 500, transition_time: 200, handle_size: 2, + intellihide: true, }), margin: 0, opacity: 1.0, diff --git a/cosmic-panel-config/src/panel_config.rs b/cosmic-panel-config/src/panel_config.rs index f1897b8..ecf3391 100644 --- a/cosmic-panel-config/src/panel_config.rs +++ b/cosmic-panel-config/src/panel_config.rs @@ -234,11 +234,13 @@ pub struct AutoHide { /// size of the handle in pixels /// should be > 0 pub handle_size: u32, + /// Intellihide + pub intellihide: bool, } impl Default for AutoHide { fn default() -> Self { - Self { wait_time: 1000, transition_time: 200, handle_size: 4 } + Self { wait_time: 1000, transition_time: 200, handle_size: 4, intellihide: true } } } @@ -388,7 +390,7 @@ impl Default for CosmicPanelConfig { padding: 4, spacing: 4, exclusive_zone: true, - autohide: None, + autohide: Some(AutoHide::default()), border_radius: 8, margin: 4, opacity: 0.8, @@ -505,7 +507,7 @@ impl CosmicPanelConfig { } pub fn exclusive_zone(&self) -> bool { - self.exclusive_zone + self.exclusive_zone || self.autohide.is_none() } pub fn autohide(&self) -> Option { From 2f73fa3e85a22e5acd9c1114f6c162b26695009a Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Mon, 25 Nov 2024 17:11:42 -0500 Subject: [PATCH 3/8] wip: overlap notify --- cosmic-panel-bin/src/space/layout.rs | 104 +++++++++++------------- cosmic-panel-config/src/panel_config.rs | 5 ++ 2 files changed, 54 insertions(+), 55 deletions(-) diff --git a/cosmic-panel-bin/src/space/layout.rs b/cosmic-panel-bin/src/space/layout.rs index afd82c7..420fd34 100644 --- a/cosmic-panel-bin/src/space/layout.rs +++ b/cosmic-panel-bin/src/space/layout.rs @@ -677,61 +677,6 @@ impl PanelSpace { border_color: [0.0, 0.0, 0.0, 0.0], }; - input_region.subtract(i32::MIN / 2, i32::MIN / 2, i32::MAX, i32::MAX); - let anim_gap = self.anchor_gap; - - if is_dock { - let (layer_length, actual_length) = if self.config.is_horizontal() { - (new_dim.w, self.actual_size.w) - } else { - (new_dim.h, self.actual_size.h) - }; - let side = (layer_length as u32 - actual_length as u32) / 2; - - let (loc, size) = match self.config.anchor { - PanelAnchor::Left => ( - (-1, side as i32), - ( - new_logical_crosswise_dim + self.gap() as i32 + 1 + anim_gap, - container_length, - ), - ), - PanelAnchor::Right => ( - (0, side as i32), - ( - new_logical_crosswise_dim + self.gap() as i32 + 1 - anim_gap, - container_length, - ), - ), - PanelAnchor::Top => ( - (side as i32, -1), - ( - container_length, - new_logical_crosswise_dim + self.gap() as i32 + 1 + anim_gap, - ), - ), - PanelAnchor::Bottom => ( - (side as i32, 0), - ( - container_length, - new_logical_crosswise_dim + self.gap() as i32 + 1 - -anim_gap, - ), - ), - }; - - input_region.add(loc.0, loc.1, size.0, size.1); - } else { - let (loc, size) = match self.config.anchor { - PanelAnchor::Left => ((-1, 0), (new_dim.w + 1 + anim_gap, new_dim.h)), - PanelAnchor::Right => ((0, 0), (new_dim.w + 1 - anim_gap, new_dim.h)), - PanelAnchor::Top => ((0, -1), (new_dim.w, new_dim.h + 1 + anim_gap)), - PanelAnchor::Bottom => ((0, 0), (new_dim.w, new_dim.h + 1 - anim_gap)), - }; - - input_region.add(loc.0, loc.1, size.0, size.1); - }; - layer.wl_surface().set_input_region(Some(input_region.wl_region())); - let Some(output) = self.output.as_ref().map(|o| o.1.clone()) else { bail!("output missing"); }; @@ -770,6 +715,55 @@ impl PanelSpace { self.background_element = Some(bg.clone()); self.space.map_element(CosmicMappedInternal::Background(bg), (0, 0), false); } + input_region.subtract(0, 0, i32::MAX, i32::MAX); + let anim_gap = self.anchor_gap; + + if is_dock { + let (layer_length, actual_length) = if self.config.is_horizontal() { + (new_dim.w, self.actual_size.w) + } else { + (new_dim.h, self.actual_size.h) + }; + let side = (layer_length as u32 - actual_length as u32) / 2; + + let (loc, size) = match self.config.anchor { + PanelAnchor::Left => ( + (-1, side as i32), + ( + new_logical_crosswise_dim + self.gap() as i32 + 1 + anim_gap, + container_length, + ), + ), + PanelAnchor::Right => ( + (0, side as i32 - anim_gap), + (new_logical_crosswise_dim + self.gap() as i32 + 1, container_length), + ), + PanelAnchor::Top => ( + (side as i32, -1), + ( + container_length, + new_logical_crosswise_dim + self.gap() as i32 + 1 + anim_gap, + ), + ), + PanelAnchor::Bottom => ( + (side as i32, 0 - anim_gap), + (container_length, new_logical_crosswise_dim + self.gap() as i32 + 1), + ), + }; + + input_region.add(loc.0, loc.1, size.0, size.1); + } else { + let (loc, size) = match self.config.anchor { + PanelAnchor::Left => ((-1, 0), (new_dim.w + 1 + anim_gap, new_dim.h)), + PanelAnchor::Right => ((0, -anim_gap), (new_dim.w + 1 + anim_gap, new_dim.h)), + PanelAnchor::Top => ((0, -1), (new_dim.w, new_dim.h + 1 + anim_gap)), + PanelAnchor::Bottom => ((0, -anim_gap), (new_dim.w, new_dim.h + 1 + anim_gap)), + }; + + input_region.add(loc.0, loc.1, size.0, size.1); + }; + layer.wl_surface().set_input_region(Some(input_region.wl_region())); + self.reorder_overflow_space(OverflowSection::Left); self.reorder_overflow_space(OverflowSection::Center); self.reorder_overflow_space(OverflowSection::Right); diff --git a/cosmic-panel-config/src/panel_config.rs b/cosmic-panel-config/src/panel_config.rs index ecf3391..aec45ff 100644 --- a/cosmic-panel-config/src/panel_config.rs +++ b/cosmic-panel-config/src/panel_config.rs @@ -222,6 +222,10 @@ pub enum CosmicPanelBackground { Color([f32; 3]), } +const fn _default_true() -> bool { + true +} + // TODO configurable interpolation type? /// configurable autohide behavior #[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)] @@ -235,6 +239,7 @@ pub struct AutoHide { /// should be > 0 pub handle_size: u32, /// Intellihide + #[serde(default = "_default_true")] pub intellihide: bool, } From 20c6d1a6f99cc3c582e4491d5a5ea237bdfcc2cc Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Tue, 26 Nov 2024 10:31:34 -0500 Subject: [PATCH 4/8] refactor: intellihide always enabled if autohiding --- cosmic-panel-bin/src/space/panel_space.rs | 9 ++++----- cosmic-panel-config/src/container_config.rs | 1 - cosmic-panel-config/src/panel_config.rs | 5 +---- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/cosmic-panel-bin/src/space/panel_space.rs b/cosmic-panel-bin/src/space/panel_space.rs index a8c3e57..9ee1676 100644 --- a/cosmic-panel-bin/src/space/panel_space.rs +++ b/cosmic-panel-bin/src/space/panel_space.rs @@ -448,16 +448,14 @@ impl PanelSpace { return; }; - let (cur_hover, intellihide) = { + let cur_hover = { let c_focused_surface = self.c_focused_surface.borrow(); let c_hovered_surface = self.c_hovered_surface.borrow(); // no transition if not configured for autohide let no_hover_focus = c_focused_surface.iter().all(|f| matches!(f.2, FocusStatus::LastFocused(_))) && c_hovered_surface.iter().all(|f| matches!(f.2, FocusStatus::LastFocused(_))); - let intellihide = if let Some(autohide) = self.config.autohide() { - autohide.intellihide && self.overlap_notify.is_some() - } else { + if self.config.autohide().is_none() { if no_hover_focus && self.animate_state.is_none() { self.additional_gap = 0; self.visibility = Visibility::Hidden; @@ -500,9 +498,10 @@ impl PanelSpace { } }, ); - (f, intellihide) + f }; + let intellihide = self.overlap_notify.is_some(); match self.visibility { Visibility::Hidden => { if matches!(cur_hover, FocusStatus::Focused) diff --git a/cosmic-panel-config/src/container_config.rs b/cosmic-panel-config/src/container_config.rs index 3b3cef1..f2a4442 100644 --- a/cosmic-panel-config/src/container_config.rs +++ b/cosmic-panel-config/src/container_config.rs @@ -192,7 +192,6 @@ impl Default for CosmicPanelContainerConfig { wait_time: 500, transition_time: 200, handle_size: 2, - intellihide: true, }), margin: 0, opacity: 1.0, diff --git a/cosmic-panel-config/src/panel_config.rs b/cosmic-panel-config/src/panel_config.rs index aec45ff..b2edea3 100644 --- a/cosmic-panel-config/src/panel_config.rs +++ b/cosmic-panel-config/src/panel_config.rs @@ -238,14 +238,11 @@ pub struct AutoHide { /// size of the handle in pixels /// should be > 0 pub handle_size: u32, - /// Intellihide - #[serde(default = "_default_true")] - pub intellihide: bool, } impl Default for AutoHide { fn default() -> Self { - Self { wait_time: 1000, transition_time: 200, handle_size: 4, intellihide: true } + Self { wait_time: 1000, transition_time: 200, handle_size: 4 } } } From f84016ef00d7e7152bbd3f5dde5ed90d43a4e2d5 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Tue, 26 Nov 2024 15:26:09 -0500 Subject: [PATCH 5/8] fix: typo --- cosmic-panel-bin/src/space/layout.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cosmic-panel-bin/src/space/layout.rs b/cosmic-panel-bin/src/space/layout.rs index 420fd34..4876da8 100644 --- a/cosmic-panel-bin/src/space/layout.rs +++ b/cosmic-panel-bin/src/space/layout.rs @@ -755,7 +755,7 @@ impl PanelSpace { } else { let (loc, size) = match self.config.anchor { PanelAnchor::Left => ((-1, 0), (new_dim.w + 1 + anim_gap, new_dim.h)), - PanelAnchor::Right => ((0, -anim_gap), (new_dim.w + 1 + anim_gap, new_dim.h)), + PanelAnchor::Right => ((-anim_gap, 0), (new_dim.w + 1 + anim_gap, new_dim.h)), PanelAnchor::Top => ((0, -1), (new_dim.w, new_dim.h + 1 + anim_gap)), PanelAnchor::Bottom => ((0, -anim_gap), (new_dim.w, new_dim.h + 1 + anim_gap)), }; From 4f05e603dac2f8ac1de89a3038807fb8125d874f Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Tue, 26 Nov 2024 17:37:26 -0500 Subject: [PATCH 6/8] fix: namespace --- cosmic-panel-bin/src/space/wrapper_space.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cosmic-panel-bin/src/space/wrapper_space.rs b/cosmic-panel-bin/src/space/wrapper_space.rs index bea7e4a..ee7239e 100644 --- a/cosmic-panel-bin/src/space/wrapper_space.rs +++ b/cosmic-panel-bin/src/space/wrapper_space.rs @@ -1343,8 +1343,13 @@ impl WrapperSpace for PanelSpace { }; let surface = compositor_state.create_surface(qh); - let client_surface = - layer_state.create_layer_surface(qh, surface, layer, Some("Panel"), c_output.as_ref()); + let client_surface = layer_state.create_layer_surface( + qh, + surface, + layer, + Some(self.config.name.clone()), + c_output.as_ref(), + ); // client_surface.set_margin(margin.top, margin.right, margin.bottom, // margin.left); client_surface.set_keyboard_interactivity(match self.config.keyboard_interactivity { From 2f8c6a1663d382fa1dbffcdc60356aa172464864 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Wed, 27 Nov 2024 11:24:39 -0500 Subject: [PATCH 7/8] refactor: add namespace --- Cargo.lock | 1370 ++++++++++++++++++++++++++++------- cosmic-panel-bin/Cargo.toml | 2 +- 2 files changed, 1121 insertions(+), 251 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d05945b..f26d65a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,73 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "ab_glyph" +version = "0.2.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3672c180e71eeaaac3a541fbbc5f5ad4def8b747c595ad30d674e43049f7b0" +dependencies = [ + "ab_glyph_rasterizer", + "owned_ttf_parser", +] + +[[package]] +name = "ab_glyph_rasterizer" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" + +[[package]] +name = "accesskit" +version = "0.16.0" +source = "git+https://github.com/wash2/accesskit?tag=iced-xdg-surface-0.13#956955342dadab7e588e21be726817fca39510f3" + +[[package]] +name = "accesskit_consumer" +version = "0.24.0" +source = "git+https://github.com/wash2/accesskit?tag=iced-xdg-surface-0.13#956955342dadab7e588e21be726817fca39510f3" +dependencies = [ + "accesskit", + "immutable-chunkmap", +] + +[[package]] +name = "accesskit_macos" +version = "0.17.0" +source = "git+https://github.com/wash2/accesskit?tag=iced-xdg-surface-0.13#956955342dadab7e588e21be726817fca39510f3" +dependencies = [ + "accesskit", + "accesskit_consumer", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "once_cell", +] + +[[package]] +name = "accesskit_windows" +version = "0.22.0" +source = "git+https://github.com/wash2/accesskit?tag=iced-xdg-surface-0.13#956955342dadab7e588e21be726817fca39510f3" +dependencies = [ + "accesskit", + "accesskit_consumer", + "paste", + "static_assertions", + "windows 0.54.0", +] + +[[package]] +name = "accesskit_winit" +version = "0.22.0" +source = "git+https://github.com/wash2/accesskit?tag=iced-xdg-surface-0.13#956955342dadab7e588e21be726817fca39510f3" +dependencies = [ + "accesskit", + "accesskit_macos", + "accesskit_windows", + "raw-window-handle", + "winit", +] + [[package]] name = "addr2line" version = "0.24.2" @@ -11,12 +78,6 @@ dependencies = [ "gimli", ] -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - [[package]] name = "adler2" version = "2.0.0" @@ -30,6 +91,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", + "getrandom", "once_cell", "version_check", "zerocopy", @@ -52,9 +114,9 @@ checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" [[package]] name = "allocator-api2" -version = "0.2.18" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +checksum = "45862d1c77f2228b9e10bc609d5bc203d86ebc9b87ad8d5d5167a6c9abf739d9" [[package]] name = "almost" @@ -62,6 +124,33 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3aa2999eb46af81abb65c2d30d446778d7e613b60bbf4e174a027e80f90a3c14" +[[package]] +name = "android-activity" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef6978589202a00cd7e118380c448a08b6ed394c3a8df3a430d0898e3a42d046" +dependencies = [ + "android-properties", + "bitflags 2.6.0", + "cc", + "cesu8", + "jni", + "jni-sys", + "libc", + "log", + "ndk", + "ndk-context", + "ndk-sys 0.6.0+11769913", + "num_enum", + "thiserror", +] + +[[package]] +name = "android-properties" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -79,9 +168,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.91" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" +checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" [[package]] name = "appendlist" @@ -190,9 +279,9 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.4" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" +checksum = "43a2b323ccce0a1d90b449fd71f2a06ca7faa7c54c2751f06c9bd851fc061059" dependencies = [ "async-lock", "cfg-if", @@ -245,7 +334,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -280,7 +369,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -314,7 +403,7 @@ dependencies = [ "addr2line", "cfg-if", "libc", - "miniz_oxide 0.8.0", + "miniz_oxide", "object", "rustc-demangle", "windows-targets 0.52.6", @@ -383,6 +472,15 @@ dependencies = [ "generic-array", ] +[[package]] +name = "block2" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" +dependencies = [ + "objc2", +] + [[package]] name = "blocking" version = "1.6.1" @@ -410,9 +508,9 @@ checksum = "64fa3c856b712db6612c019f14756e64e4bcea13337a6b33b696333a9eaa2d06" [[package]] name = "bytemuck" -version = "1.19.0" +version = "1.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8334215b81e418a0a7bdb8ef0849474f40bb10c8b71f1c4ed315cff49f32494d" +checksum = "8b37c88a63ffd85d15b406896cc343916d7cf57838a847b3a6f2ca5d39a5695a" dependencies = [ "bytemuck_derive", ] @@ -425,7 +523,7 @@ checksum = "bcfcc3cd946cb52f0bbfdbbcfa2f4e24f75ebb6c0e1002f7c25904fada18b9ec" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -440,6 +538,20 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" +[[package]] +name = "calloop" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec" +dependencies = [ + "bitflags 2.6.0", + "log", + "polling", + "rustix", + "slab", + "thiserror", +] + [[package]] name = "calloop" version = "0.14.1" @@ -460,7 +572,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a7a1dbbe026a55ef47a500b123af5a9a0914520f061d467914cf21be95daf" dependencies = [ - "calloop", + "calloop 0.14.1", "rustix", "wayland-backend", "wayland-client", @@ -468,13 +580,21 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.31" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" +checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" dependencies = [ + "jobserver", + "libc", "shlex", ] +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + [[package]] name = "cfg-if" version = "1.0.0" @@ -632,6 +752,16 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + [[package]] name = "concurrent-queue" version = "2.5.0" @@ -704,7 +834,7 @@ dependencies = [ [[package]] name = "cosmic-client-toolkit" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-protocols?rev=1eaeece#1eaeeced06a5268171c03130a677692947cd026c" +source = "git+https://github.com/pop-os/cosmic-protocols?rev=d218c76#d218c76b58c7a3b20dd5e7943f93fc306a1b81b8" dependencies = [ "cosmic-protocols", "libc", @@ -716,7 +846,7 @@ dependencies = [ [[package]] name = "cosmic-config" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#fde0516484750e0a7d2499e54964c5ed6ba8e16b" +source = "git+https://github.com/pop-os/libcosmic#a6db807c1bbffc90b68513171348cad0b4469eac" dependencies = [ "atomicwrites", "cosmic-config-derive", @@ -734,7 +864,7 @@ dependencies = [ [[package]] name = "cosmic-config-derive" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#fde0516484750e0a7d2499e54964c5ed6ba8e16b" +source = "git+https://github.com/pop-os/libcosmic#a6db807c1bbffc90b68513171348cad0b4469eac" dependencies = [ "quote", "syn 1.0.109", @@ -743,7 +873,7 @@ dependencies = [ [[package]] name = "cosmic-notifications-util" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-notifications#980b9621332502af4754c837f54e514282581c2f" +source = "git+https://github.com/pop-os/cosmic-notifications#d4d5f429337004c1721e0072ad1c25509229586f" dependencies = [ "bytemuck", "serde", @@ -757,7 +887,7 @@ version = "0.1.0" dependencies = [ "anyhow", "bytemuck", - "calloop", + "calloop 0.14.1", "cosmic-client-toolkit", "cosmic-notifications-util", "cosmic-panel-config", @@ -815,7 +945,7 @@ dependencies = [ [[package]] name = "cosmic-protocols" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-protocols?rev=1eaeece#1eaeeced06a5268171c03130a677692947cd026c" +source = "git+https://github.com/pop-os/cosmic-protocols?rev=d218c76#d218c76b58c7a3b20dd5e7943f93fc306a1b81b8" dependencies = [ "bitflags 2.6.0", "wayland-backend", @@ -829,7 +959,7 @@ dependencies = [ [[package]] name = "cosmic-text" version = "0.12.1" -source = "git+https://github.com/pop-os/cosmic-text.git#4fe90bb6126c22f589b46768d7754d65ae300c5e" +source = "git+https://github.com/pop-os/cosmic-text.git#1f4065c1c3399efad58841082212f7c039b58480" dependencies = [ "bitflags 2.6.0", "fontdb 0.16.2", @@ -852,7 +982,7 @@ dependencies = [ [[package]] name = "cosmic-theme" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#fde0516484750e0a7d2499e54964c5ed6ba8e16b" +source = "git+https://github.com/pop-os/libcosmic#a6db807c1bbffc90b68513171348cad0b4469eac" dependencies = [ "almost", "cosmic-config", @@ -868,9 +998,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] @@ -994,7 +1124,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -1005,7 +1135,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -1023,7 +1153,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -1057,6 +1187,23 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "dispatch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + [[package]] name = "dlib" version = "0.5.2" @@ -1102,6 +1249,11 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" +[[package]] +name = "dpi" +version = "0.1.1" +source = "git+https://github.com/pop-os/winit.git?tag=iced-xdg-surface-0.13#1cc02bdab141072eaabad639d74b032fd0fcc62e" + [[package]] name = "drm" version = "0.11.1" @@ -1205,7 +1357,7 @@ checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -1272,15 +1424,14 @@ dependencies = [ [[package]] name = "exr" -version = "1.72.0" +version = "1.73.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "887d93f60543e9a9362ef8a21beedd0a833c5d9610e18c67abe15a5963dcb1a4" +checksum = "f83197f59927b46c04a183a619b7c29df34e63e63c7869320862268c0ef687e0" dependencies = [ "bit_field", - "flume", "half", "lebe", - "miniz_oxide 0.7.4", + "miniz_oxide", "rayon-core", "smallvec", "zune-inflate", @@ -1294,9 +1445,9 @@ checksum = "dd2e7510819d6fbf51a5545c8f922716ecfb14df168a3242f7d33e0239efe6a1" [[package]] name = "fastrand" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" [[package]] name = "fdeflate" @@ -1321,12 +1472,12 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.34" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", - "miniz_oxide 0.8.0", + "miniz_oxide", ] [[package]] @@ -1341,15 +1492,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8bf7cc16383c4b8d58b9905a8509f02926ce3058053c056376248d958c9df1e8" -[[package]] -name = "flume" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095" -dependencies = [ - "spin", -] - [[package]] name = "fnv" version = "1.0.7" @@ -1358,9 +1500,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "font-types" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dda6e36206148f69fc6ecb1bb6c0dedd7ee469f3db1d0dc2045beea28430ca43" +checksum = "b3971f9a5ca983419cdc386941ba3b9e1feba01a0ab888adf78739feb2798492" dependencies = [ "bytemuck", ] @@ -1420,7 +1562,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -1438,16 +1580,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "fraction" -version = "0.15.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f158e3ff0a1b334408dc9fb811cd99b446986f4d8b741bb08f9df1604085ae7" -dependencies = [ - "lazy_static", - "num", -] - [[package]] name = "freedesktop-desktop-entry" version = "0.6.2" @@ -1537,9 +1669,9 @@ checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" -version = "2.3.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" +checksum = "cef40d21ae2c515b51041df9ed313ed21e572df340ea58a922a0aefe7e8891a1" dependencies = [ "fastrand", "futures-core", @@ -1556,7 +1688,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -1591,9 +1723,9 @@ dependencies = [ [[package]] name = "gbm" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c724107aa10444b1d2709aae4727c18a33c16b3e15ea8a46cc4ae226c084c88a" +checksum = "fa9a106f044fbd21edf2d8cc57300df1e60630e46ed4bebd59cdcbb23cfad1ce" dependencies = [ "bitflags 2.6.0", "drm 0.14.1", @@ -1747,7 +1879,7 @@ dependencies = [ "presser", "thiserror", "winapi", - "windows", + "windows 0.52.0", ] [[package]] @@ -1808,9 +1940,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "hassle-rs" @@ -1868,7 +2000,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "windows-core 0.52.0", ] [[package]] @@ -1883,28 +2015,40 @@ dependencies = [ [[package]] name = "iced" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#fde0516484750e0a7d2499e54964c5ed6ba8e16b" +source = "git+https://github.com/pop-os/libcosmic#a6db807c1bbffc90b68513171348cad0b4469eac" dependencies = [ "dnd", + "iced_accessibility", "iced_core", "iced_futures", "iced_renderer", "iced_widget", + "iced_winit", "image", "mime", "thiserror", "window_clipboard", ] +[[package]] +name = "iced_accessibility" +version = "0.1.0" +source = "git+https://github.com/pop-os/libcosmic#a6db807c1bbffc90b68513171348cad0b4469eac" +dependencies = [ + "accesskit", + "accesskit_winit", +] + [[package]] name = "iced_core" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#fde0516484750e0a7d2499e54964c5ed6ba8e16b" +source = "git+https://github.com/pop-os/libcosmic#a6db807c1bbffc90b68513171348cad0b4469eac" dependencies = [ "bitflags 2.6.0", "bytes", "dnd", "glam", + "iced_accessibility", "log", "mime", "num-traits", @@ -1922,7 +2066,7 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#fde0516484750e0a7d2499e54964c5ed6ba8e16b" +source = "git+https://github.com/pop-os/libcosmic#a6db807c1bbffc90b68513171348cad0b4469eac" dependencies = [ "futures", "iced_core", @@ -1947,7 +2091,7 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#fde0516484750e0a7d2499e54964c5ed6ba8e16b" +source = "git+https://github.com/pop-os/libcosmic#a6db807c1bbffc90b68513171348cad0b4469eac" dependencies = [ "bitflags 2.6.0", "bytemuck", @@ -1969,7 +2113,7 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#fde0516484750e0a7d2499e54964c5ed6ba8e16b" +source = "git+https://github.com/pop-os/libcosmic#a6db807c1bbffc90b68513171348cad0b4469eac" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -1981,10 +2125,11 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#fde0516484750e0a7d2499e54964c5ed6ba8e16b" +source = "git+https://github.com/pop-os/libcosmic#a6db807c1bbffc90b68513171348cad0b4469eac" dependencies = [ "bytes", "dnd", + "iced_accessibility", "iced_core", "iced_futures", "raw-window-handle", @@ -1995,7 +2140,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#fde0516484750e0a7d2499e54964c5ed6ba8e16b" +source = "git+https://github.com/pop-os/libcosmic#a6db807c1bbffc90b68513171348cad0b4469eac" dependencies = [ "bytemuck", "cosmic-text", @@ -2011,7 +2156,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#fde0516484750e0a7d2499e54964c5ed6ba8e16b" +source = "git+https://github.com/pop-os/libcosmic#a6db807c1bbffc90b68513171348cad0b4469eac" dependencies = [ "as-raw-xcb-connection", "bitflags 2.6.0", @@ -2042,9 +2187,10 @@ dependencies = [ [[package]] name = "iced_widget" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic#fde0516484750e0a7d2499e54964c5ed6ba8e16b" +source = "git+https://github.com/pop-os/libcosmic#a6db807c1bbffc90b68513171348cad0b4469eac" dependencies = [ "dnd", + "iced_accessibility", "iced_renderer", "iced_runtime", "num-traits", @@ -2056,6 +2202,145 @@ dependencies = [ "window_clipboard", ] +[[package]] +name = "iced_winit" +version = "0.14.0-dev" +source = "git+https://github.com/pop-os/libcosmic#a6db807c1bbffc90b68513171348cad0b4469eac" +dependencies = [ + "dnd", + "iced_accessibility", + "iced_futures", + "iced_graphics", + "iced_runtime", + "log", + "rustc-hash 2.0.0", + "thiserror", + "tracing", + "wasm-bindgen-futures", + "web-sys", + "winapi", + "window_clipboard", + "winit", +] + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -2064,12 +2349,23 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] @@ -2096,6 +2392,15 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "029d73f573d8e8d63e6d5020011d3255b28c3ba85d6cf870a07184ed23de9284" +[[package]] +name = "immutable-chunkmap" +version = "2.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f97096f508d54f8f8ab8957862eee2ccd628847b6217af1a335e1c44dee578" +dependencies = [ + "arrayvec", +] + [[package]] name = "indexmap" version = "2.6.0" @@ -2103,7 +2408,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.15.0", + "hashbrown 0.15.2", ] [[package]] @@ -2161,9 +2466,25 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" + +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", + "windows-sys 0.45.0", +] [[package]] name = "jni-sys" @@ -2171,6 +2492,15 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" +[[package]] +name = "jobserver" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] + [[package]] name = "jpeg-decoder" version = "0.3.1" @@ -2267,7 +2597,7 @@ dependencies = [ [[package]] name = "launch-pad" version = "0.1.0" -source = "git+https://github.com/pop-os/launch-pad.git#8b585a9da02f5feb762658e263d5241eb97194e8" +source = "git+https://github.com/pop-os/launch-pad.git#1aa34f26f2cd3d3a82496a9678d340a4773821cd" dependencies = [ "log", "nix 0.26.4", @@ -2293,14 +2623,14 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" [[package]] name = "libc" -version = "0.2.161" +version = "0.2.166" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" +checksum = "c2ccc108bbc0b1331bd061864e7cd823c0cab660bbe6970e66e2c0614decde36" [[package]] name = "libcosmic" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#fde0516484750e0a7d2499e54964c5ed6ba8e16b" +source = "git+https://github.com/pop-os/libcosmic#a6db807c1bbffc90b68513171348cad0b4469eac" dependencies = [ "apply", "chrono", @@ -2308,9 +2638,9 @@ dependencies = [ "cosmic-theme", "css-color", "derive_setters", - "fraction", "freedesktop-icons", "iced", + "iced_accessibility", "iced_core", "iced_futures", "iced_renderer", @@ -2341,9 +2671,9 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a00419de735aac21d53b0de5ce2c03bd3627277cf471300f27ebc89f7d828047" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "libredox" @@ -2368,6 +2698,12 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a385b1be4e5c3e362ad2ffa73c392e53f031eaa5b7d648e64cd87f27f6063d7" +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + [[package]] name = "litrs" version = "0.4.1" @@ -2554,15 +2890,6 @@ dependencies = [ "smithay-clipboard", ] -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - [[package]] name = "miniz_oxide" version = "0.8.0" @@ -2625,17 +2952,47 @@ dependencies = [ ] [[package]] -name = "ndk-sys" -version = "0.5.0+25.2.9519653" +name = "ndk" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691" +checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" dependencies = [ + "bitflags 2.6.0", "jni-sys", + "log", + "ndk-sys 0.6.0+11769913", + "num_enum", + "raw-window-handle", + "thiserror", ] [[package]] -name = "nix" -version = "0.26.4" +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-sys" +version = "0.5.0+25.2.9519653" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "ndk-sys" +version = "0.6.0+11769913" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "nix" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" dependencies = [ @@ -2689,107 +3046,276 @@ dependencies = [ ] [[package]] -name = "num" -version = "0.4.3" +name = "num-integer" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", "num-traits", ] [[package]] -name = "num-bigint" -version = "0.4.6" +name = "num-traits" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ - "num-integer", - "num-traits", + "autocfg", + "libm", ] [[package]] -name = "num-complex" -version = "0.4.6" +name = "num_cpus" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "num-traits", + "hermit-abi 0.3.9", + "libc", ] [[package]] -name = "num-integer" -version = "0.1.46" +name = "num_enum" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" dependencies = [ - "num-traits", + "num_enum_derive", ] [[package]] -name = "num-iter" -version = "0.1.45" +name = "num_enum_derive" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "autocfg", - "num-integer", - "num-traits", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.89", ] [[package]] -name = "num-rational" -version = "0.4.2" +name = "objc" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" dependencies = [ - "num-bigint", - "num-integer", - "num-traits", + "malloc_buf", ] [[package]] -name = "num-traits" -version = "0.2.19" +name = "objc-foundation" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" dependencies = [ - "autocfg", - "libm", + "block", + "objc", + "objc_id", ] [[package]] -name = "num_cpus" -version = "1.16.0" +name = "objc-sys" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" + +[[package]] +name = "objc2" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" dependencies = [ - "hermit-abi 0.3.9", + "objc-sys", + "objc2-encode", +] + +[[package]] +name = "objc2-app-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" +dependencies = [ + "bitflags 2.6.0", + "block2", "libc", + "objc2", + "objc2-core-data", + "objc2-core-image", + "objc2-foundation", + "objc2-quartz-core", ] [[package]] -name = "objc" -version = "0.2.7" +name = "objc2-cloud-kit" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" dependencies = [ - "malloc_buf", + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-core-location", + "objc2-foundation", ] [[package]] -name = "objc-foundation" -version = "0.1.1" +name = "objc2-contacts" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" +checksum = "a5ff520e9c33812fd374d8deecef01d4a840e7b41862d849513de77e44aa4889" dependencies = [ - "block", - "objc", - "objc_id", + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-data" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-image" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" +dependencies = [ + "block2", + "objc2", + "objc2-foundation", + "objc2-metal", +] + +[[package]] +name = "objc2-core-location" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "000cfee34e683244f284252ee206a27953279d370e309649dc3ee317b37e5781" +dependencies = [ + "block2", + "objc2", + "objc2-contacts", + "objc2-foundation", +] + +[[package]] +name = "objc2-encode" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7891e71393cd1f227313c9379a26a584ff3d7e6e7159e988851f0934c993f0f8" + +[[package]] +name = "objc2-foundation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" +dependencies = [ + "bitflags 2.6.0", + "block2", + "dispatch", + "libc", + "objc2", +] + +[[package]] +name = "objc2-link-presentation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a1ae721c5e35be65f01a03b6d2ac13a54cb4fa70d8a5da293d7b0020261398" +dependencies = [ + "block2", + "objc2", + "objc2-app-kit", + "objc2-foundation", +] + +[[package]] +name = "objc2-metal" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-foundation", + "objc2-metal", +] + +[[package]] +name = "objc2-symbols" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a684efe3dec1b305badae1a28f6555f6ddd3bb2c2267896782858d5a78404dc" +dependencies = [ + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-ui-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-cloud-kit", + "objc2-core-data", + "objc2-core-image", + "objc2-core-location", + "objc2-foundation", + "objc2-link-presentation", + "objc2-quartz-core", + "objc2-symbols", + "objc2-uniform-type-identifiers", + "objc2-user-notifications", +] + +[[package]] +name = "objc2-uniform-type-identifiers" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44fa5f9748dbfe1ca6c0b79ad20725a11eca7c2218bceb4b005cb1be26273bfe" +dependencies = [ + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-user-notifications" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-core-location", + "objc2-foundation", ] [[package]] @@ -2822,11 +3348,20 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "orbclient" +version = "0.3.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba0b26cec2e24f08ed8bb31519a9333140a6599b867dac464bb150bdb796fd43" +dependencies = [ + "libredox", +] + [[package]] name = "ordered-float" -version = "4.4.0" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83e7ccb95e240b7c9506a3d544f10d935e142cc90b0a1d56954fb44d89ad6b97" +checksum = "c65ee1f9701bf938026630b455d5315f490640234259037edb259798b3bcf85e" dependencies = [ "num-traits", ] @@ -2873,7 +3408,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -2882,6 +3417,15 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +[[package]] +name = "owned_ttf_parser" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec719bbf3b2a81c109a4e20b1f129b5566b7dce654bc3872f6a05abf82b2c4" +dependencies = [ + "ttf-parser 0.25.0", +] + [[package]] name = "palette" version = "0.7.6" @@ -2904,7 +3448,7 @@ dependencies = [ "by_address", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -3003,7 +3547,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -3038,7 +3582,7 @@ checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -3080,14 +3624,14 @@ dependencies = [ "crc32fast", "fdeflate", "flate2", - "miniz_oxide 0.8.0", + "miniz_oxide", ] [[package]] name = "polling" -version = "3.7.3" +version = "3.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" +checksum = "a604568c3202727d1507653cb121dbd627a58684eb09a820fd746bee38b4442f" dependencies = [ "cfg-if", "concurrent-queue", @@ -3124,9 +3668,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.89" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -3139,7 +3683,7 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", "version_check", "yansi", ] @@ -3160,7 +3704,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a65f2e60fbf1063868558d69c6beacf412dc755f9fc020f514b7955fc914fe30" dependencies = [ "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -3314,7 +3858,7 @@ checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.8", + "regex-automata 0.4.9", "regex-syntax 0.8.5", ] @@ -3329,9 +3873,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -3429,9 +3973,9 @@ checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustix" -version = "0.38.38" +version = "0.38.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa260229e6538e52293eeb577aabd09945a09d6d9cc0fc550ed7529056c2e32a" +checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" dependencies = [ "bitflags 2.6.0", "errno", @@ -3484,6 +4028,19 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sctk-adwaita" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6277f0217056f77f1d8f49f2950ac6c278c0d607c45f5ee99328d792ede24ec" +dependencies = [ + "ab_glyph", + "log", + "memmap2 0.9.5", + "smithay-client-toolkit", + "tiny-skia", +] + [[package]] name = "self_cell" version = "1.0.4" @@ -3501,29 +4058,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] name = "serde_json" -version = "1.0.132" +version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ "indexmap", "itoa", @@ -3540,7 +4097,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -3646,7 +4203,7 @@ source = "git+https://github.com/smithay/smithay?rev=df79eeb#df79eeba63a8e9c2d33 dependencies = [ "appendlist", "bitflags 2.6.0", - "calloop", + "calloop 0.14.1", "cgmath", "cursor-icon", "downcast-rs", @@ -3679,11 +4236,11 @@ dependencies = [ [[package]] name = "smithay-client-toolkit" version = "0.19.2" -source = "git+https://github.com/Smithay/client-toolkit//#618a876400cb6c6b07a8ac5d3557f404602ec077" +source = "git+https://github.com/Smithay/client-toolkit//#25079ae75cb6952b0542aa343bd5a52c81d135d4" dependencies = [ "bitflags 2.6.0", "bytemuck", - "calloop", + "calloop 0.14.1", "calloop-wayland-source", "cursor-icon", "libc", @@ -3763,15 +4320,6 @@ dependencies = [ "x11rb", ] -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -dependencies = [ - "lock_api", -] - [[package]] name = "spirv" version = "0.3.0+sdk-1.3.268.0" @@ -3781,6 +4329,12 @@ dependencies = [ "bitflags 2.6.0", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "static_assertions" version = "1.1.0" @@ -3810,9 +4364,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "svg_fmt" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20e16a0f46cf5fd675563ef54f26e83e20f2366bcf027bcb3cc3ed2b98aaf2ca" +checksum = "ce5d813d71d82c4cbc1742135004e4a79fd870214c155443451c139c9470a0aa" [[package]] name = "svgtypes" @@ -3848,9 +4402,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.85" +version = "2.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" +checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" dependencies = [ "proc-macro2", "quote", @@ -3859,15 +4413,26 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] [[package]] name = "sys-locale" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e801cf239ecd6ccd71f03d270d67dd53d13e90aab208bf4b8fe4ad957ea949b0" +checksum = "8eab9a99a024a169fe8a903cf9d4a3b3601109bcc13bd9e3c6fff259138626c4" dependencies = [ "libc", ] @@ -3891,9 +4456,9 @@ checksum = "bc1ee6eef34f12f765cb94725905c6312b6610ab2b0940889cfe58dae7bc3c72" [[package]] name = "tempfile" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", "fastrand", @@ -3913,28 +4478,28 @@ dependencies = [ [[package]] name = "textdistance" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f1835c76a9d443834c04539860f3ce46b9d93ef8c260057f939e967ca81180a" +checksum = "aa672c55ab69f787dbc9126cc387dbe57fdd595f585e4524cf89018fa44ab819" [[package]] name = "thiserror" -version = "1.0.65" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.65" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -4006,6 +4571,16 @@ dependencies = [ "tracing", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -4023,9 +4598,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.41.0" +version = "1.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" +checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" dependencies = [ "backtrace", "bytes", @@ -4047,7 +4622,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] @@ -4094,20 +4669,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", "valuable", @@ -4185,6 +4760,12 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c591d83f69777866b9126b24c6dd9a18351f177e49d625920d19f989fd31cf8" +[[package]] +name = "ttf-parser" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5902c5d130972a0000f60860bfbf46f7ca3db5391eddfedd1b8728bd9dc96c0e" + [[package]] name = "typenum" version = "1.17.0" @@ -4222,9 +4803,9 @@ checksum = "1df77b101bcc4ea3d78dafc5ad7e4f58ceffe0b2b16bf446aeb50b6cb4157656" [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-linebreak" @@ -4232,15 +4813,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" -[[package]] -name = "unicode-normalization" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" -dependencies = [ - "tinyvec", -] - [[package]] name = "unicode-properties" version = "0.1.3" @@ -4279,9 +4851,9 @@ checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "url" -version = "2.5.2" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", @@ -4328,6 +4900,18 @@ dependencies = [ "xmlwriter", ] +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "valuable" version = "0.1.0" @@ -4378,7 +4962,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", "wasm-bindgen-shared", ] @@ -4412,7 +4996,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4522,6 +5106,19 @@ dependencies = [ "wayland-server", ] +[[package]] +name = "wayland-protocols-plasma" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b31cab548ee68c7eb155517f2212049dc151f7cd7910c2b66abfd31c3ee12bd" +dependencies = [ + "bitflags 2.6.0", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", +] + [[package]] name = "wayland-protocols-wlr" version = "0.3.5" @@ -4679,7 +5276,7 @@ dependencies = [ "log", "metal", "naga", - "ndk-sys", + "ndk-sys 0.5.0+25.2.9519653", "objc", "once_cell", "parking_lot 0.12.3", @@ -4765,7 +5362,19 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ - "windows-core", + "windows-core 0.52.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows" +version = "0.54.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49" +dependencies = [ + "windows-core 0.54.0", + "windows-implement", + "windows-interface", "windows-targets 0.52.6", ] @@ -4778,6 +5387,56 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-core" +version = "0.54.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-implement" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "942ac266be9249c84ca862f0a164a39533dc2f6f33dc98ec89c8da99b82ea0bd" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + +[[package]] +name = "windows-interface" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da33557140a288fae4e1d5f8873aaf9eb6613a9cf82c3e070223ff177f598b60" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + +[[package]] +name = "windows-result" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -4805,6 +5464,21 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -4836,6 +5510,12 @@ dependencies = [ "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -4848,6 +5528,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -4860,6 +5546,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -4878,6 +5570,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -4890,6 +5588,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -4902,6 +5606,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -4914,6 +5624,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -4926,6 +5642,57 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "winit" +version = "0.30.5" +source = "git+https://github.com/pop-os/winit.git?tag=iced-xdg-surface-0.13#1cc02bdab141072eaabad639d74b032fd0fcc62e" +dependencies = [ + "ahash", + "android-activity", + "atomic-waker", + "bitflags 2.6.0", + "block2", + "bytemuck", + "calloop 0.13.0", + "cfg_aliases 0.2.1", + "concurrent-queue", + "core-foundation", + "core-graphics", + "cursor-icon", + "dpi", + "js-sys", + "libc", + "memmap2 0.9.5", + "ndk", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "objc2-ui-kit", + "orbclient", + "percent-encoding", + "pin-project", + "raw-window-handle", + "redox_syscall 0.4.1", + "rustix", + "sctk-adwaita", + "smithay-client-toolkit", + "smol_str", + "tracing", + "unicode-segmentation", + "wasm-bindgen", + "wasm-bindgen-futures", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-protocols-plasma", + "web-sys", + "web-time", + "windows-sys 0.52.0", + "x11-dl", + "x11rb", + "xkbcommon-dl", +] + [[package]] name = "winnow" version = "0.6.20" @@ -4935,6 +5702,29 @@ dependencies = [ "memchr", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "x11-dl" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" +dependencies = [ + "libc", + "once_cell", + "pkg-config", +] + [[package]] name = "x11rb" version = "0.13.1" @@ -5008,6 +5798,19 @@ dependencies = [ "xkeysym", ] +[[package]] +name = "xkbcommon-dl" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" +dependencies = [ + "bitflags 2.6.0", + "dlib", + "log", + "once_cell", + "xkeysym", +] + [[package]] name = "xkeysym" version = "0.2.1" @@ -5019,9 +5822,9 @@ dependencies = [ [[package]] name = "xml-rs" -version = "0.8.22" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af4e2e2f7cba5a093896c1e150fbfe177d1883e7448200efb81d40b9d339ef26" +checksum = "af310deaae937e48a26602b730250b4949e125f468f11e6990be3e5304ddd96f" [[package]] name = "xmlwriter" @@ -5041,6 +5844,30 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c94451ac9513335b5e23d7a8a2b61a7102398b8cca5160829d313e84c9d98be1" +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", + "synstructure", +] + [[package]] name = "zbus" version = "4.4.0" @@ -5089,7 +5916,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", "zvariant_utils", ] @@ -5128,7 +5955,50 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", + "synstructure", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", ] [[package]] @@ -5162,7 +6032,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", "zvariant_utils", ] @@ -5174,5 +6044,5 @@ checksum = "c51bcff7cc3dbb5055396bcf774748c3dab426b4b8659046963523cee4808340" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.89", ] diff --git a/cosmic-panel-bin/Cargo.toml b/cosmic-panel-bin/Cargo.toml index ab7cb75..bf91d62 100644 --- a/cosmic-panel-bin/Cargo.toml +++ b/cosmic-panel-bin/Cargo.toml @@ -24,7 +24,7 @@ sctk.workspace = true wayland-protocols = { version = "0.32.1", features = ["staging"] } xdg-shell-wrapper-config = { path = "../xdg-shell-wrapper-config" } -cctk = { package = "cosmic-client-toolkit", git = "https://github.com/pop-os/cosmic-protocols", rev = "1eaeece" } +cctk = { package = "cosmic-client-toolkit", git = "https://github.com/pop-os/cosmic-protocols", rev = "d218c76" } # cctk = { package = "cosmic-client-toolkit", path = "../../cosmic-protocols/client-toolkit" } wayland-egl = "0.32.1" wayland-protocols-wlr = { version = "0.3.1", features = ["client"] } From 5f209198f3b8b95c3a1969cf0b0374260ae350ff Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Wed, 27 Nov 2024 15:05:26 -0500 Subject: [PATCH 8/8] fix: rounded rectangle crop position --- .../src/iced/elements/overflow_button.rs | 10 +++------- cosmic-panel-bin/src/space/layout.rs | 19 +++++++++++++++---- .../client/handlers/keyboard.rs | 3 ++- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/cosmic-panel-bin/src/iced/elements/overflow_button.rs b/cosmic-panel-bin/src/iced/elements/overflow_button.rs index 86ef3dd..c4a2f63 100644 --- a/cosmic-panel-bin/src/iced/elements/overflow_button.rs +++ b/cosmic-panel-bin/src/iced/elements/overflow_button.rs @@ -9,14 +9,10 @@ use std::{ }; use calloop::LoopHandle; -use cctk::wayland_client::protocol::wl_subsurface::WlSubsurface; // element for rendering a button that toggles the overflow popup when clicked use crate::xdg_shell_wrapper::{self, shared_state::GlobalState}; use cosmic::{ - iced::{ - alignment::{Horizontal, Vertical}, - Length, Padding, - }, + iced::{Length, Padding}, iced_core::id, theme::{self, Button}, widget::{button, layer_container, Id}, @@ -184,8 +180,8 @@ impl Program for OverflowButton { .width(Length::Fixed(self.icon_size as f32)) .height(Length::Fixed(self.icon_size as f32)), ) - .align_x(Horizontal::Center) - .align_y(Vertical::Center) + .align_x(cosmic::iced::Alignment::Center) + .align_y(cosmic::iced::Alignment::Center) .width(Length::Fixed(self.icon_size as f32 + self.button_padding.horizontal())) .height(Length::Fixed(self.icon_size as f32 + self.button_padding.horizontal())), ) diff --git a/cosmic-panel-bin/src/space/layout.rs b/cosmic-panel-bin/src/space/layout.rs index 4876da8..ca02656 100644 --- a/cosmic-panel-bin/src/space/layout.rs +++ b/cosmic-panel-bin/src/space/layout.rs @@ -20,6 +20,7 @@ use crate::{ }, minimize::MinimizeApplet, space::{corner_element::RoundedRectangleSettings, Alignment}, + xdg_shell_wrapper::space::Visibility, }; use super::{ @@ -643,6 +644,10 @@ impl PanelSpace { p.logical_height == h && p.logical_width == w && self.bg_color() == p.color }) }) || self.animate_state.as_ref().is_some() + || matches!( + self.visibility, + Visibility::TransitionToHidden { .. } | Visibility::TransitionToVisible { .. } + ) { if let Some(bg) = self.background_element.take() { self.space.unmap_elem(&CosmicMappedInternal::Background(bg)); @@ -658,11 +663,17 @@ impl PanelSpace { (PanelAnchor::Top, 0) => (0., 0., border_radius, border_radius), _ => (border_radius, border_radius, border_radius, border_radius), }; + + let anim_gap_scaled = self.anchor_gap as f32 * self.scale as f32; let loc = match self.config.anchor { - PanelAnchor::Left => [gap_scaled as f32, container_lengthwise_pos_scaled], - PanelAnchor::Right => [0., container_lengthwise_pos_scaled], - PanelAnchor::Top => [container_lengthwise_pos_scaled, 0.], - PanelAnchor::Bottom => [container_lengthwise_pos_scaled, gap_scaled as f32], + PanelAnchor::Left => { + [gap_scaled as f32 + anim_gap_scaled, container_lengthwise_pos_scaled] + }, + PanelAnchor::Right => [-anim_gap_scaled, container_lengthwise_pos_scaled], + PanelAnchor::Top => [container_lengthwise_pos_scaled, -anim_gap_scaled], + PanelAnchor::Bottom => { + [container_lengthwise_pos_scaled, gap_scaled as f32 + anim_gap_scaled] + }, }; self.panel_rect_settings = RoundedRectangleSettings { rad_tl: rad_tl as f32, diff --git a/cosmic-panel-bin/src/xdg_shell_wrapper/client/handlers/keyboard.rs b/cosmic-panel-bin/src/xdg_shell_wrapper/client/handlers/keyboard.rs index 145de26..6a5e3db 100644 --- a/cosmic-panel-bin/src/xdg_shell_wrapper/client/handlers/keyboard.rs +++ b/cosmic-panel-bin/src/xdg_shell_wrapper/client/handlers/keyboard.rs @@ -6,7 +6,7 @@ use crate::xdg_shell_wrapper::{ }; use sctk::{ delegate_keyboard, - seat::keyboard::{KeyCode, KeyboardHandler, Keysym, RepeatInfo}, + seat::keyboard::{KeyCode, KeyboardHandler, Keysym, RawModifiers, RepeatInfo}, shell::WaylandSurface, }; use smithay::{backend::input::KeyState, input::keyboard::FilterResult, utils::SERIAL_COUNTER}; @@ -263,6 +263,7 @@ impl KeyboardHandler for GlobalState { _keyboard: &sctk::reexports::client::protocol::wl_keyboard::WlKeyboard, _serial: u32, _modifiers: sctk::seat::keyboard::Modifiers, + _: RawModifiers, _: u32, ) { // TODO should these be handled specially