chore: Rust 2024 and update dependencies

This commit is contained in:
Vukašin Vojinović 2025-09-10 14:18:51 +02:00 committed by Ian Douglas Scott
parent 05c9af1b95
commit a939335b9e
23 changed files with 941 additions and 722 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
target/
.cargo/
vendor.tar
vendor/

1537
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,16 +1,16 @@
[package]
name = "cosmic-workspaces"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]
anyhow = "1.0.75"
calloop = { version = "0.14.2", features = ["executor"] }
anyhow = "1.0.99"
calloop = { version = "0.14.3", features = ["executor"] }
clap = { version = "4", features = ["derive"] }
cosmic-bg-config = { git = "https://github.com/pop-os/cosmic-bg" }
cosmic-comp-config = { git = "https://github.com/pop-os/cosmic-comp" }
env_logger = "0.11.0"
futures-channel = "0.3.25"
env_logger = "0.11.8"
futures-channel = "0.3.31"
gbm = "0.18.0"
libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = false, features = [
"tokio",
@ -23,21 +23,21 @@ libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = fa
cosmic-config = { git = "https://github.com/pop-os/libcosmic" }
freedesktop-icons = { package = "cosmic-freedesktop-icons", git = "https://github.com/pop-os/freedesktop-icons" }
memmap2 = "0.9.0"
tokio = "1.23.0"
wayland-protocols = "0.32.1"
delegate = "0.13.0"
memmap2 = "0.9.8"
tokio = "1.47.1"
wayland-protocols = "0.32.9"
delegate = "0.13.4"
itertools = "0.14.0"
log = "0.4.20"
i18n-embed-fl = "0.9.0"
rust-embed = "8.1.0"
rustix = { version = "1.0.7", features = ["fs", "shm"] }
calloop-wayland-source = "0.4.0"
log = "0.4.28"
i18n-embed-fl = "0.10"
rust-embed = "8.7.2"
rustix = { version = "1.1.2", features = ["fs", "shm"] }
calloop-wayland-source = "0.4.1"
aliasable = "0.1.3"
futures-executor = { version = "0.3.31", features = ["thread-pool"] }
[dependencies.i18n-embed]
version = "0.15.3"
version = "0.16"
features = ["fluent-system", "desktop-requester"]
[features]

View file

@ -9,14 +9,14 @@ use cosmic::{
workspace::v2::client::zcosmic_workspace_handle_v2,
},
wayland_client::{
protocol::{wl_output, wl_shm},
Connection, WEnum,
protocol::{wl_output, wl_shm},
},
wayland_protocols::ext::workspace::v1::client::ext_workspace_handle_v1,
},
iced::{
self,
futures::{executor::block_on, FutureExt, SinkExt},
futures::{FutureExt, SinkExt, executor::block_on},
},
iced_winit::platform_specific::wayland::subsurface_widget::{Shmbuf, SubsurfaceBuffer},
};
@ -27,8 +27,8 @@ use std::{
fs,
io::{self, Write},
sync::{
atomic::{AtomicU32, Ordering},
Arc,
atomic::{AtomicU32, Ordering},
},
thread,
};

View file

@ -35,7 +35,7 @@ pub use wayland::subscription;
mod mock;
#[cfg(feature = "mock-backend")]
pub use mock::{
subscription, ExtForeignToplevelHandleV1, ExtWorkspaceHandleV1, ToplevelInfo, Workspace,
ExtForeignToplevelHandleV1, ExtWorkspaceHandleV1, ToplevelInfo, Workspace, subscription,
};
#[derive(Clone, Debug, Default)]

View file

@ -1,8 +1,8 @@
use cctk::{
screencopy::Formats,
wayland_client::{
protocol::{wl_buffer, wl_shm, wl_shm_pool},
Connection, Dispatch, QueueHandle,
protocol::{wl_buffer, wl_shm, wl_shm_pool},
},
};
use cosmic::{
@ -87,7 +87,6 @@ impl AppData {
let Some((_dev_path, gbm)) = self.gbm_devices.gbm_device(drm_dev)? else {
return Ok(None);
};
let formats = feedback.format_table();
let modifiers = modifiers
.iter()

View file

@ -3,7 +3,7 @@ use cctk::{
self,
dmabuf::{DmabufFeedback, DmabufHandler, DmabufState},
},
wayland_client::{protocol::wl_buffer, Connection, QueueHandle},
wayland_client::{Connection, QueueHandle, protocol::wl_buffer},
};
use cosmic::cctk;

View file

@ -15,7 +15,7 @@ use cctk::{
toplevel_info::ToplevelInfoState,
toplevel_management::ToplevelManagerState,
wayland_client::{
globals::registry_queue_init, protocol::wl_seat, Connection, Proxy, QueueHandle,
Connection, Proxy, QueueHandle, globals::registry_queue_init, protocol::wl_seat,
},
workspace::WorkspaceState,
};
@ -23,7 +23,7 @@ use cosmic::{
cctk,
iced::{
self,
futures::{executor::block_on, FutureExt, SinkExt},
futures::{FutureExt, SinkExt, executor::block_on},
},
};
use futures_channel::mpsc;

View file

@ -1,7 +1,7 @@
//! Types related to drag-and-drop
use cosmic::{
cctk::wayland_client::{protocol::wl_output, Proxy},
cctk::wayland_client::{Proxy, protocol::wl_output},
iced::clipboard::mime::AsMimeTypes,
};
use std::{borrow::Cow, sync::LazyLock};

View file

@ -2,8 +2,8 @@
// SPDX-License-Identifier: GPL-3.0-only
use i18n_embed::{
fluent::{fluent_language_loader, FluentLanguageLoader},
DefaultLocalizer, LanguageLoader, Localizer,
fluent::{FluentLanguageLoader, fluent_language_loader},
};
use rust_embed::RustEmbed;
use std::sync::LazyLock;

View file

@ -7,7 +7,7 @@ use cctk::{
cosmic_protocols::toplevel_management::v1::client::zcosmic_toplevel_manager_v1,
cosmic_protocols::workspace::v2::client::zcosmic_workspace_handle_v2,
sctk::shell::wlr_layer::{Anchor, KeyboardInteractivity, Layer},
wayland_client::{protocol::wl_output, Connection, Proxy},
wayland_client::{Connection, Proxy, protocol::wl_output},
wayland_protocols::ext::workspace::v1::client::ext_workspace_handle_v1,
};
use clap::Parser;
@ -15,12 +15,11 @@ use cosmic::{
app::{Application, CosmicFlags},
cctk, dbus_activation,
iced::{
self,
self, Size, Subscription, Task,
clipboard::dnd::{DndEvent, SourceEvent},
event::wayland::{Event as WaylandEvent, LayerEvent, OutputEvent},
keyboard::key::{Key, Named},
mouse::ScrollDelta,
Size, Subscription, Task,
},
iced_core::window::Id as SurfaceId,
iced_runtime::platform_specific::wayland::layer_surface::{
@ -31,7 +30,7 @@ use cosmic::{
},
};
use cosmic_comp_config::CosmicCompConfig;
use cosmic_config::{cosmic_config_derive::CosmicConfigEntry, CosmicConfigEntry};
use cosmic_config::{CosmicConfigEntry, cosmic_config_derive::CosmicConfigEntry};
use i18n_embed::DesktopLanguageRequester;
use std::{
collections::{HashMap, HashSet},

View file

@ -1,4 +1,5 @@
use cosmic::{
Apply,
cctk::{
cosmic_protocols::{
toplevel_info::v1::client::zcosmic_toplevel_handle_v1,
@ -8,24 +9,22 @@ use cosmic::{
wayland_protocols::ext::workspace::v1::client::ext_workspace_handle_v1,
},
iced::{
self,
self, Alignment, Border, Length,
advanced::layout::flex::Axis,
clipboard::mime::{AllowedMimeTypes, AsMimeTypes},
widget::{column, row},
Alignment, Border, Length,
},
iced_core::{text::Wrapping, Shadow},
iced_core::{Shadow, text::Wrapping},
iced_winit::platform_specific::wayland::subsurface_widget::Subsurface,
widget::{self, Widget},
Apply,
};
use cosmic_comp_config::workspace::WorkspaceLayout;
use std::collections::{HashMap, HashSet};
use crate::{
App, LayerSurface, Msg, Toplevel, Workspace,
backend::{self, CaptureImage},
dnd::{Drag, DragSurface, DragToplevel, DragWorkspace, DropTarget},
App, LayerSurface, Msg, Toplevel, Workspace,
};
fn dnd_source_with_drag_surface<D: AsMimeTypes + Send + Clone + 'static>(
@ -291,8 +290,8 @@ fn workspace_item(
"workspace",
HashMap::from([("number", &workspace.info.name)])
))
.width(Length::Fill)
.align_x(Alignment::Center),
.apply(widget::container)
.center_x(Length::Fill),
pin_button(workspace),
];
@ -304,7 +303,7 @@ fn workspace_item(
.spacing(4)
.align_x(Alignment::Center)
.apply(widget::container)
.max_height(image_height + 26.0)
.max_height(image_height + 28.0)
.max_width(image_width);
let is_active = workspace.is_active() && !has_workspace_drag;

View file

@ -2,14 +2,14 @@
use cosmic::{
iced::{
Length, Rectangle, Size, Vector,
advanced::{
Clipboard, Layout, Shell, Widget,
layout::{self},
mouse, overlay, renderer,
widget::{tree, Operation, Tree},
Clipboard, Layout, Shell, Widget,
widget::{Operation, Tree, tree},
},
event::{self, Event},
Length, Rectangle, Size, Vector,
},
iced_core::Renderer,
};

View file

@ -1,13 +1,12 @@
//! Show one surface, sized to match the size of another (invisible) widget
use cosmic::iced::{
Length, Rectangle, Size,
advanced::{
layout, mouse, renderer,
Clipboard, Layout, Shell, Widget, layout, mouse, renderer,
widget::{Operation, Tree},
Clipboard, Layout, Shell, Widget,
},
event::{self, Event},
Length, Rectangle, Size,
};
use std::marker::PhantomData;

View file

@ -1,11 +1,10 @@
use cosmic::iced::{
Length, Rectangle, Size, Vector,
advanced::{
layout, mouse, overlay, renderer,
widget::{tree, Id, Operation, Tree},
Clipboard, Layout, Shell, Widget,
Clipboard, Layout, Shell, Widget, layout, mouse, overlay, renderer,
widget::{Id, Operation, Tree, tree},
},
event::{self, Event},
Length, Rectangle, Size, Vector,
};
use std::marker::PhantomData;

View file

@ -1,11 +1,10 @@
use cosmic::iced::{
Length, Rectangle, Size, Vector,
advanced::{
layout, mouse, overlay, renderer,
widget::{tree, Id, Operation, Tree},
Clipboard, Layout, Shell, Widget,
Clipboard, Layout, Shell, Widget, layout, mouse, overlay, renderer,
widget::{Id, Operation, Tree, tree},
},
event::{self, Event},
Length, Rectangle, Size, Vector,
};
use std::marker::PhantomData;

View file

@ -1,14 +1,14 @@
// This widget defines it's cross axis size as the `index`th child's size
use cosmic::iced::{
Length, Point, Rectangle, Size,
advanced::{
Clipboard, Layout, Shell, Widget,
layout::{self, flex::Axis},
mouse, renderer,
widget::{Operation, Tree},
Clipboard, Layout, Shell, Widget,
},
event::{self, Event},
Length, Point, Rectangle, Size,
};
use std::marker::PhantomData;

View file

@ -1,12 +1,12 @@
use cosmic::iced::{
Length, Rectangle, Size, Vector,
advanced::{
Clipboard, Layout, Shell, Widget,
layout::{self, flex::Axis},
mouse, renderer,
widget::{Operation, Tree},
Clipboard, Layout, Shell, Widget,
},
event::{self, Event},
Length, Rectangle, Size, Vector,
};
use std::marker::PhantomData;

View file

@ -1,5 +1,5 @@
use aliasable::vec::AliasableVec;
use cosmic::iced::{advanced::layout::flex::Axis, Length, Point, Rectangle, Size};
use cosmic::iced::{Length, Point, Rectangle, Size, advanced::layout::flex::Axis};
use std::marker::PhantomData;
use super::{LayoutToplevel, ToplevelLayout};

View file

@ -1,8 +1,8 @@
use cosmic::iced::{advanced::layout::flex::Axis, Length};
use cosmic::iced::{Length, advanced::layout::flex::Axis};
use super::{
axis_toplevel_layout::{AxisPoint, AxisRectangle, AxisSize, AxisToplevelLayout},
LayoutToplevel,
axis_toplevel_layout::{AxisPoint, AxisRectangle, AxisSize, AxisToplevelLayout},
};
pub(crate) struct RowColToplevelLayout {

View file

@ -1,9 +1,9 @@
use cosmic::iced::{advanced::layout::flex::Axis, Length};
use cosmic::iced::{Length, advanced::layout::flex::Axis};
use super::{
LayoutToplevel,
axis_toplevel_layout::{AxisRectangle, AxisSize, AxisToplevelLayout},
row_col_toplevel_layout::RowColToplevelLayout,
LayoutToplevel,
};
pub(crate) struct TwoRowColToplevelLayout(RowColToplevelLayout);

View file

@ -2,13 +2,12 @@
//! takes the same space but does not draw.
use cosmic::iced::{
Length, Rectangle, Size,
advanced::{
layout, mouse, renderer,
Clipboard, Layout, Shell, Widget, layout, mouse, renderer,
widget::{Operation, Tree},
Clipboard, Layout, Shell, Widget,
},
event::{self, Event},
Length, Rectangle, Size,
};
use std::marker::PhantomData;

View file

@ -2,15 +2,15 @@
// Gives each child widget a maximum size on main axis of total/n
use cosmic::iced::{
Length, Point, Rectangle, Size,
advanced::{
Clipboard, Layout, Shell, Widget,
layout::{self, flex::Axis},
mouse, renderer,
widget::{Operation, Tree},
Clipboard, Layout, Shell, Widget,
},
core::clipboard::DndDestinationRectangles,
event::{self, Event},
Length, Point, Rectangle, Size,
};
use std::marker::PhantomData;