yoda: cargo fix --lib across all crates — drop ~115 trivial warnings
Some checks are pending
Audit / vulnerabilities (push) Waiting to run
Check / wasm (push) Waiting to run
Check / widget (push) Waiting to run
Document / all (push) Waiting to run
Format / all (push) Waiting to run
Lint / all (push) Waiting to run
Test / all (macOS-latest, 1.88) (push) Waiting to run
Test / all (macOS-latest, beta) (push) Waiting to run
Test / all (macOS-latest, stable) (push) Waiting to run
Test / all (ubuntu-latest, 1.88) (push) Waiting to run
Test / all (ubuntu-latest, beta) (push) Waiting to run
Test / all (ubuntu-latest, stable) (push) Waiting to run
Test / all (windows-latest, 1.88) (push) Waiting to run
Test / all (windows-latest, beta) (push) Waiting to run
Test / all (windows-latest, stable) (push) Waiting to run

Auto-applied suggestions (unused imports, _-prefixed unused params,
redundant mutability) on iced_core, iced_widget, iced_runtime, iced_winit,
iced_wgpu, iced_graphics, iced_tiny_skia. From 170 warnings down to 55.

Leyoda 2026 – GPLv3
This commit is contained in:
Votre Nom 2026-05-05 16:45:37 +02:00
parent f388dfdfe4
commit 8a7a32ff92
45 changed files with 85 additions and 139 deletions

View file

@ -1,4 +1,4 @@
use crate::event::{self, Event}; use crate::event::Event;
use crate::id::Id; use crate::id::Id;
use crate::layout; use crate::layout;
use crate::mouse; use crate::mouse;

View file

@ -3,7 +3,7 @@ use crate::mouse;
use crate::overlay; use crate::overlay;
use crate::renderer; use crate::renderer;
use crate::widget; use crate::widget;
use crate::{Clipboard, Event, Layout, Overlay, Point, Rectangle, Shell, Size}; use crate::{Clipboard, Event, Layout, Overlay, Shell, Size};
/// An [`Overlay`] container that displays multiple overlay [`overlay::Element`] /// An [`Overlay`] container that displays multiple overlay [`overlay::Element`]
/// children. /// children.

View file

@ -4,7 +4,7 @@ use super::Operation;
use crate::{ use crate::{
Rectangle, Rectangle,
id::Id, id::Id,
widget::operation::{Outcome, focusable::Count}, widget::operation::Outcome,
}; };
/// Produces an [`Operation`] that searches for the Id /// Produces an [`Operation`] that searches for the Id

View file

@ -25,13 +25,12 @@ use crate::layout;
use crate::mouse; use crate::mouse;
use crate::renderer; use crate::renderer;
use crate::text::paragraph::{self, Paragraph}; use crate::text::paragraph::{self, Paragraph};
use crate::text::{self, Fragment}; use crate::text::{self};
use crate::widget::tree::{self, Tree}; use crate::widget::tree::{self, Tree};
use crate::{ use crate::{
Color, Element, Layout, Length, Pixels, Rectangle, Size, Theme, Widget, Color, Element, Layout, Length, Pixels, Rectangle, Size, Theme, Widget,
}; };
use std::borrow::Cow;
pub use text::{Alignment, Ellipsize, LineHeight, Shaping, Wrapping}; pub use text::{Alignment, Ellipsize, LineHeight, Shaping, Wrapping};
/// A bunch of text. /// A bunch of text.

View file

@ -2,8 +2,6 @@
#[cfg(feature = "image")] #[cfg(feature = "image")]
use crate::core::Bytes; use crate::core::Bytes;
use crate::core::Color;
use crate::core::Radians;
use crate::core::Rectangle; use crate::core::Rectangle;
use crate::core::image; use crate::core::image;
use crate::core::svg; use crate::core::svg;

View file

@ -1,10 +1,8 @@
//! Access the clipboard. //! Access the clipboard.
use std::any::Any;
use dnd::{DndDestinationRectangle, DndSurface}; use dnd::{DndDestinationRectangle, DndSurface};
use iced_core::clipboard::DndSource; use window_clipboard::mime::AllowedMimeTypes;
use window_clipboard::mime::{AllowedMimeTypes, AsMimeTypes};
use crate::{oneshot, task, Action, Task}; use crate::{oneshot, task, Action, Task};

View file

@ -28,7 +28,6 @@ pub use task::Task;
pub use user_interface::UserInterface; pub use user_interface::UserInterface;
pub use window::Window; pub use window::Window;
use crate::core::Color;
use crate::futures::futures::channel::oneshot; use crate::futures::futures::channel::oneshot;
use std::borrow::Cow; use std::borrow::Cow;

View file

@ -1,14 +1,12 @@
use std::any::Any;
use std::fmt; use std::fmt;
use std::hash::{Hash, Hasher}; use std::hash::{Hash, Hasher};
use std::sync::Arc;
use cctk::sctk::reexports::protocols::xdg::shell::client::xdg_positioner::{ use cctk::sctk::reexports::protocols::xdg::shell::client::xdg_positioner::{
Anchor, Gravity, Anchor, Gravity,
}; };
use iced_core::layout::Limits; use iced_core::layout::Limits;
use iced_core::window::Id; use iced_core::window::Id;
use iced_core::{Element, Rectangle}; use iced_core::Rectangle;
/// Popup creation details /// Popup creation details
#[derive(Debug, Clone)] #[derive(Debug, Clone)]

View file

@ -1,14 +1,9 @@
use std::any::Any;
use std::fmt; use std::fmt;
use std::hash::{Hash, Hasher}; use std::hash::{Hash, Hasher};
use std::sync::Arc;
use cctk::sctk::reexports::protocols::xdg::shell::client::xdg_positioner::{ use cctk::sctk::reexports::protocols::xdg::shell::client::xdg_positioner::Gravity;
Anchor, Gravity,
};
use iced_core::layout::Limits;
use iced_core::window::Id; use iced_core::window::Id;
use iced_core::{Element, Point, Rectangle, Size}; use iced_core::{Point, Rectangle, Size};
/// Subsurface creation details /// Subsurface creation details
#[derive(Debug, Clone)] #[derive(Debug, Clone)]

View file

@ -57,7 +57,7 @@ impl Pipeline {
let width_scale = bounds.width / image.width() as f32; let width_scale = bounds.width / image.width() as f32;
let height_scale = bounds.height / image.height() as f32; let height_scale = bounds.height / image.height() as f32;
let quality = match filter_method { let _quality = match filter_method {
raster::FilterMethod::Linear => tiny_skia::FilterQuality::Bilinear, raster::FilterMethod::Linear => tiny_skia::FilterQuality::Bilinear,
raster::FilterMethod::Nearest => tiny_skia::FilterQuality::Nearest, raster::FilterMethod::Nearest => tiny_skia::FilterQuality::Nearest,
}; };

View file

@ -1,4 +1,3 @@
use crate::core::Radians;
use crate::core::{ use crate::core::{
self, Background, Color, Point, Rectangle, Svg, Transformation, renderer, self, Background, Color, Point, Rectangle, Svg, Transformation, renderer,
}; };

View file

@ -64,8 +64,8 @@ pub use geometry::Geometry;
use crate::core::renderer; use crate::core::renderer;
use crate::core::{ use crate::core::{
Background, Color, Font, Pixels, Point, Radians, Rectangle, Size, Background, Color, Font, Pixels, Point, Rectangle, Size,
Transformation, Vector, image::FilterMethod, Transformation, Vector,
}; };
use crate::graphics::mesh; use crate::graphics::mesh;
use crate::graphics::text::{Editor, Paragraph}; use crate::graphics::text::{Editor, Paragraph};

View file

@ -18,7 +18,6 @@ use crate::{Engine, Renderer};
use super::wayland::get_wayland_device_ids; use super::wayland::get_wayland_device_ids;
#[cfg(all(unix, feature = "x11", not(target_os = "macos"), not(target_os = "redox")))] #[cfg(all(unix, feature = "x11", not(target_os = "macos"), not(target_os = "redox")))]
use super::x11::get_x11_device_ids; use super::x11::get_x11_device_ids;
use std::future::Future;
/// A window graphics backend for iced powered by `wgpu`. /// A window graphics backend for iced powered by `wgpu`.
pub struct Compositor { pub struct Compositor {

View file

@ -599,7 +599,7 @@ where
(x + width) as f64, (x + width) as f64,
(y + height) as f64, (y + height) as f64,
); );
let is_hovered = state.state.downcast_ref::<State>().is_hovered; let _is_hovered = state.state.downcast_ref::<State>().is_hovered;
let mut node = Node::new(Role::Button); let mut node = Node::new(Role::Button);
node.add_action(Action::Focus); node.add_action(Action::Focus);

View file

@ -536,7 +536,7 @@ where
}; };
let bounds = layout.bounds(); let bounds = layout.bounds();
let is_hovered = cursor.is_over(bounds); let _is_hovered = cursor.is_over(bounds);
let Rectangle { let Rectangle {
x, x,
y, y,

View file

@ -35,7 +35,7 @@ use crate::core::{
color, color,
}; };
use iced_runtime::{Action, Task, task}; use iced_runtime::{Task, task};
/// A widget that aligns its contents inside of its boundaries. /// A widget that aligns its contents inside of its boundaries.
/// ///

View file

@ -293,8 +293,8 @@ fn drawing_bounds<Renderer, Handle>(
content_fit: ContentFit, content_fit: ContentFit,
rotation: Rotation, rotation: Rotation,
scale: f32, scale: f32,
opacity: f32, _opacity: f32,
border_radius: [f32; 4], _border_radius: [f32; 4],
) -> Rectangle ) -> Rectangle
where where
Renderer: image::Renderer<Handle = Handle>, Renderer: image::Renderer<Handle = Handle>,

View file

@ -1,7 +1,6 @@
//! Keyed columns distribute content vertically while keeping continuity. //! Keyed columns distribute content vertically while keeping continuity.
//! Distribute content vertically. //! Distribute content vertically.
use crate::core::event;
use crate::core::layout; use crate::core::layout;
use crate::core::mouse; use crate::core::mouse;
use crate::core::overlay; use crate::core::overlay;

View file

@ -15,7 +15,7 @@ use crate::core::mouse;
use crate::core::overlay; use crate::core::overlay;
use crate::core::renderer; use crate::core::renderer;
use crate::core::widget::tree::{self, Tree}; use crate::core::widget::tree::{self, Tree};
use crate::core::widget::{self, Widget}; use crate::core::widget::Widget;
use crate::core::{ use crate::core::{
self, Clipboard, Event, Length, Rectangle, Shell, Size, Vector, self, Clipboard, Event, Length, Rectangle, Shell, Size, Vector,
}; };

View file

@ -527,11 +527,11 @@ where
renderer: &Renderer, renderer: &Renderer,
dnd_rectangles: &mut core::clipboard::DndDestinationRectangles, dnd_rectangles: &mut core::clipboard::DndDestinationRectangles,
) { ) {
let mut tree = tree let tree = tree
.state .state
.downcast_ref::<Rc<RefCell<Option<Tree>>>>() .downcast_ref::<Rc<RefCell<Option<Tree>>>>()
.borrow_mut(); .borrow_mut();
let mut tree = tree.as_ref().unwrap(); let tree = tree.as_ref().unwrap();
self.with_element(|element| { self.with_element(|element| {
element.as_widget().drag_destinations( element.as_widget().drag_destinations(
&tree.children[0], &tree.children[0],

View file

@ -1,5 +1,5 @@
#![allow(missing_docs)] #![allow(missing_docs)]
use crate::core::event::{self, Event}; use crate::core::event::Event;
use crate::core::layout; use crate::core::layout;
use crate::core::mouse; use crate::core::mouse;
use crate::core::overlay; use crate::core::overlay;

View file

@ -2,7 +2,6 @@
use iced_renderer::core::mouse::Click; use iced_renderer::core::mouse::Click;
use crate::core::event;
use crate::core::layout; use crate::core::layout;
use crate::core::mouse; use crate::core::mouse;
use crate::core::overlay; use crate::core::overlay;

View file

@ -6,7 +6,7 @@ use crate::core::renderer;
use crate::core::widget::{self, Tree}; use crate::core::widget::{self, Tree};
use crate::core::{ use crate::core::{
self, Clipboard, Element, Event, Layout, Point, Rectangle, Shell, Size, self, Clipboard, Element, Event, Layout, Point, Rectangle, Shell, Size,
Vector, event, Vector,
}; };
use crate::pane_grid::{Draggable, TitleBar}; use crate::pane_grid::{Draggable, TitleBar};

View file

@ -27,7 +27,6 @@ use iced_runtime::core::widget::Id;
#[cfg(feature = "a11y")] #[cfg(feature = "a11y")]
use std::borrow::Cow; use std::borrow::Cow;
use crate::core::event;
use crate::core::keyboard; use crate::core::keyboard;
use crate::core::layout; use crate::core::layout;
use crate::core::mouse; use crate::core::mouse;
@ -933,7 +932,7 @@ where
let had_input_method = shell.input_method().is_enabled(); let had_input_method = shell.input_method().is_enabled();
let mut c_event = match event.clone() { let c_event = match event.clone() {
Event::Dnd(dnd::DndEvent::Offer( Event::Dnd(dnd::DndEvent::Offer(
id, id,
dnd::OfferEvent::Enter { dnd::OfferEvent::Enter {
@ -1586,7 +1585,7 @@ where
return A11yTree::default(); return A11yTree::default();
} }
let window = layout.bounds(); let window = layout.bounds();
let is_hovered = cursor.is_over(window); let _is_hovered = cursor.is_over(window);
let Rectangle { let Rectangle {
x, x,
y, y,
@ -1670,7 +1669,7 @@ where
})) }))
{ {
let scrollbar_bounds = scrollbar.total_bounds; let scrollbar_bounds = scrollbar.total_bounds;
let is_hovered = cursor.is_over(scrollbar_bounds); let _is_hovered = cursor.is_over(scrollbar_bounds);
let Rectangle { let Rectangle {
x, x,
y, y,

View file

@ -695,7 +695,7 @@ where
}; };
let bounds = layout.bounds(); let bounds = layout.bounds();
let is_hovered = cursor.is_over(bounds); let _is_hovered = cursor.is_over(bounds);
let Rectangle { let Rectangle {
x, x,
y, y,

View file

@ -1,6 +1,5 @@
//! Display content on top of other content. //! Display content on top of other content.
use crate::core::event;
use crate::core::layout; use crate::core::layout;
use crate::core::mouse; use crate::core::mouse;
use crate::core::overlay; use crate::core::overlay;

View file

@ -31,7 +31,6 @@ use crate::core::{
#[cfg(feature = "a11y")] #[cfg(feature = "a11y")]
use std::borrow::Cow; use std::borrow::Cow;
use std::marker::PhantomData;
use std::path::PathBuf; use std::path::PathBuf;
pub use crate::core::svg::Handle; pub use crate::core::svg::Handle;

View file

@ -1,6 +1,5 @@
use crate::container; use crate::container;
use crate::core::event;
use crate::core::layout; use crate::core::layout;
use crate::core::mouse; use crate::core::mouse;
use crate::core::overlay; use crate::core::overlay;

View file

@ -37,7 +37,6 @@ use std::borrow::Cow;
use iced_runtime::core::border::Radius; use iced_runtime::core::border::Radius;
use crate::core::alignment; use crate::core::alignment;
use crate::core::border;
use crate::core::layout; use crate::core::layout;
use crate::core::mouse; use crate::core::mouse;
use crate::core::renderer; use crate::core::renderer;
@ -509,7 +508,7 @@ where
let space = style.handle_margin; let space = style.handle_margin;
let toggler_background_bounds = Rectangle { let _toggler_background_bounds = Rectangle {
x: bounds.x, x: bounds.x,
y: bounds.y, y: bounds.y,
width: bounds.width, width: bounds.width,
@ -529,7 +528,7 @@ where
style.background, style.background,
); );
let padding = (style.padding_ratio * bounds.height).round(); let _padding = (style.padding_ratio * bounds.height).round();
let toggler_foreground_bounds = Rectangle { let toggler_foreground_bounds = Rectangle {
x: bounds.x x: bounds.x
+ if self.is_toggled { + if self.is_toggled {
@ -570,7 +569,7 @@ where
}; };
let bounds = layout.bounds(); let bounds = layout.bounds();
let is_hovered = cursor.is_over(bounds); let _is_hovered = cursor.is_over(bounds);
let Rectangle { let Rectangle {
x, x,
y, y,

View file

@ -4,7 +4,6 @@ use crate::futures::futures::channel::mpsc;
use iced_accessibility::accesskit::{ use iced_accessibility::accesskit::{
ActivationHandler, Node, NodeId, Role, Tree, TreeId, TreeUpdate, ActivationHandler, Node, NodeId, Role, Tree, TreeId, TreeUpdate,
}; };
use iced_accessibility::accesskit_winit::Adapter;
use iced_runtime::core; use iced_runtime::core;
pub struct WinitActivationHandler { pub struct WinitActivationHandler {

View file

@ -25,7 +25,7 @@ const DRAG_RESIZE_SUPPORTED: bool = false;
/// If supported by winit, returns a closure that implements cursor resize support. /// If supported by winit, returns a closure that implements cursor resize support.
pub fn event_func( pub fn event_func(
window: &dyn winit::window::Window, _window: &dyn winit::window::Window,
border_size: f64, border_size: f64,
) -> Option< ) -> Option<
Box< Box<

View file

@ -1,7 +1,7 @@
//! Access the clipboard. //! Access the clipboard.
use std::sync::Mutex; use std::sync::Mutex;
use std::{any::Any, borrow::Cow}; use std::borrow::Cow;
use crate::Control; use crate::Control;

View file

@ -3,7 +3,6 @@
//! [`winit`]: https://github.com/rust-windowing/winit //! [`winit`]: https://github.com/rust-windowing/winit
//! [`iced_runtime`]: https://github.com/iced-rs/iced/tree/0.14/runtime //! [`iced_runtime`]: https://github.com/iced-rs/iced/tree/0.14/runtime
use crate::core::input_method; use crate::core::input_method;
use std::hash::DefaultHasher;
use std::hash::Hash; use std::hash::Hash;
use std::hash::Hasher; use std::hash::Hasher;
use std::sync::Arc; use std::sync::Arc;
@ -14,7 +13,6 @@ use crate::core::theme;
use crate::core::touch; use crate::core::touch;
use crate::core::window; use crate::core::window;
use crate::core::{Event, Point, Size}; use crate::core::{Event, Point, Size};
use iced_futures::core::event::PlatformSpecific;
use winit::dpi::PhysicalPosition; use winit::dpi::PhysicalPosition;
use winit::event::ButtonSource; use winit::event::ButtonSource;
use winit::event::ElementState; use winit::event::ElementState;
@ -27,7 +25,7 @@ use winit::keyboard::SmolStr;
pub fn window_attributes( pub fn window_attributes(
settings: window::Settings, settings: window::Settings,
title: &str, title: &str,
scale_factor: f64, _scale_factor: f64,
primary_monitor: Option<winit::monitor::MonitorHandle>, primary_monitor: Option<winit::monitor::MonitorHandle>,
_id: Option<String>, _id: Option<String>,
) -> winit::window::WindowAttributes { ) -> winit::window::WindowAttributes {
@ -396,8 +394,8 @@ pub fn window_event(
Ime::Commit(content) => input_method::Event::Commit(content), Ime::Commit(content) => input_method::Event::Commit(content),
Ime::Disabled => input_method::Event::Closed, Ime::Disabled => input_method::Event::Closed,
Ime::DeleteSurrounding { Ime::DeleteSurrounding {
before_bytes, before_bytes: _,
after_bytes, after_bytes: _,
} => todo!(), } => todo!(),
})), })),
WindowEvent::Focused(focused) => Some(Event::Window(if focused { WindowEvent::Focused(focused) => Some(Event::Window(if focused {
@ -411,7 +409,7 @@ pub fn window_event(
WindowEvent::DragDropped { paths, .. } => { WindowEvent::DragDropped { paths, .. } => {
Some(Event::Window(window::Event::FileDropped(paths.clone()))) Some(Event::Window(window::Event::FileDropped(paths.clone())))
} }
WindowEvent::DragLeft { position } => { WindowEvent::DragLeft { position: _ } => {
Some(Event::Window(window::Event::FilesHoveredLeft)) Some(Event::Window(window::Event::FilesHoveredLeft))
} }
@ -707,7 +705,7 @@ enum TouchInternal {
pub fn touch_event( pub fn touch_event(
finger: FingerId, finger: FingerId,
state: TouchInternal, state: TouchInternal,
force: Option<Force>, _force: Option<Force>,
position: Option<PhysicalPosition<f64>>, position: Option<PhysicalPosition<f64>>,
scale_factor: f64, scale_factor: f64,
) -> touch::Event { ) -> touch::Event {

View file

@ -53,7 +53,6 @@ mod window;
pub use clipboard::Clipboard; pub use clipboard::Clipboard;
pub use error::Error; pub use error::Error;
pub use proxy::Proxy; pub use proxy::Proxy;
use winit::dpi::LogicalSize;
use winit::dpi::PhysicalPosition; use winit::dpi::PhysicalPosition;
use winit::dpi::PhysicalSize; use winit::dpi::PhysicalSize;
@ -322,9 +321,9 @@ where
// create initial window // create initial window
let Some(BootConfig { let Some(BootConfig {
sender, sender,
fonts, fonts: _,
graphics_settings, graphics_settings: _,
is_wayland, is_wayland: _,
}) = self.boot.take() }) = self.boot.take()
else { else {
return; return;
@ -636,10 +635,7 @@ where
#[cfg(feature = "a11y")] #[cfg(feature = "a11y")]
fn init_adapter(&mut self, event_loop: &(dyn winit::event_loop::ActiveEventLoop + 'static), id: core::window::Id, window: Arc<dyn winit::window::Window + 'static>) { fn init_adapter(&mut self, event_loop: &(dyn winit::event_loop::ActiveEventLoop + 'static), id: core::window::Id, window: Arc<dyn winit::window::Window + 'static>) {
use crate::a11y::*; use crate::a11y::*;
use iced_accessibility::accesskit::{
ActivationHandler, Node, NodeId, Role,
Tree, TreeUpdate,
};
use iced_accessibility::accesskit_winit::Adapter; use iced_accessibility::accesskit_winit::Adapter;
let node_id = let node_id =

View file

@ -1,14 +1,11 @@
//! Wayland specific shell //! Wayland specific shell
//! //!
use std::{borrow::Cow, collections::HashMap, sync::Arc}; use std::collections::HashMap;
#[cfg(all(feature = "cctk", target_os = "linux"))]
use cctk::sctk::reexports::client::Connection;
use iced_graphics::{Compositor, compositor}; use iced_graphics::{Compositor, compositor};
use iced_runtime::{ use iced_runtime::{
core::{Vector, window}, core::{Vector, window}, user_interface,
platform_specific, user_interface,
}; };
use winit::raw_window_handle::HasWindowHandle; use winit::raw_window_handle::HasWindowHandle;
@ -17,8 +14,6 @@ pub mod wayland;
#[cfg(all(feature = "cctk", target_os = "linux"))] #[cfg(all(feature = "cctk", target_os = "linux"))]
pub use wayland::*; pub use wayland::*;
#[cfg(all(feature = "cctk", target_os = "linux"))]
use wayland_backend::client::Backend;
use crate::{CreateCompositor, Program, WindowManager}; use crate::{CreateCompositor, Program, WindowManager};

View file

@ -2,8 +2,6 @@ pub mod control_flow;
pub mod proxy; pub mod proxy;
pub mod state; pub mod state;
#[cfg(feature = "a11y")]
use crate::platform_specific::SurfaceIdWrapper;
use crate::{ use crate::{
Control, Control,
futures::futures::channel::mpsc, futures::futures::channel::mpsc,
@ -43,8 +41,6 @@ use cctk::{
}; };
use raw_window_handle::HasDisplayHandle; use raw_window_handle::HasDisplayHandle;
use state::{FrameStatus, SctkWindow, send_event}; use state::{FrameStatus, SctkWindow, send_event};
#[cfg(feature = "a11y")]
use std::sync::{Arc, Mutex};
use std::{ use std::{
collections::{HashMap, HashSet}, collections::{HashMap, HashSet},
fmt::Debug, fmt::Debug,

View file

@ -29,7 +29,6 @@ use std::{
convert::Infallible, convert::Infallible,
fmt::Debug, fmt::Debug,
sync::{Arc, Mutex, atomic::AtomicU32}, sync::{Arc, Mutex, atomic::AtomicU32},
thread::panicking,
time::Duration, time::Duration,
}; };
use wayland_backend::client::ObjectId; use wayland_backend::client::ObjectId;
@ -50,7 +49,6 @@ use cctk::{
activation::{ActivationState, RequestData}, activation::{ActivationState, RequestData},
compositor::CompositorState, compositor::CompositorState,
error::GlobalError, error::GlobalError,
globals::GlobalData,
output::OutputState, output::OutputState,
reexports::{ reexports::{
calloop::{LoopHandle, timer::TimeoutAction}, calloop::{LoopHandle, timer::TimeoutAction},
@ -1258,7 +1256,7 @@ impl SctkState {
let timer = cctk::sctk::reexports::calloop::timer::Timer::from_duration(Duration::from_millis(30)); let timer = cctk::sctk::reexports::calloop::timer::Timer::from_duration(Duration::from_millis(30));
let queue_handle = self.queue_handle.clone(); let queue_handle = self.queue_handle.clone();
_ = self.loop_handle.insert_source(timer, move |_, _, state| { _ = self.loop_handle.insert_source(timer, move |_, _, state| {
let Some((mut popup, attempt)) = state.pending_popup.take() else { let Some((popup, attempt)) = state.pending_popup.take() else {
return TimeoutAction::Drop; return TimeoutAction::Drop;
}; };
@ -1574,7 +1572,7 @@ impl SctkState {
if let Some(manager) = self.corner_radius_manager.as_ref() { if let Some(manager) = self.corner_radius_manager.as_ref() {
if let Some(w) = self.windows.iter_mut().find(|w| w.id == id) { if let Some(w) = self.windows.iter_mut().find(|w| w.id == id) {
let geo_size: LogicalSize<f64> = w.window.surface_size().cast::<f64>().to_logical(w.window.scale_factor()); let geo_size: LogicalSize<f64> = w.window.surface_size().cast::<f64>().to_logical(w.window.scale_factor());
let half_min_dim = ((geo_size.width as u32).min(geo_size.height as u32) / 2); let half_min_dim = (geo_size.width as u32).min(geo_size.height as u32) / 2 ;
if let Some(radii) = v { if let Some(radii) = v {
let adjusted_radii = CornerRadius { let adjusted_radii = CornerRadius {

View file

@ -3,7 +3,6 @@ use cctk::sctk::{
delegate_activation, delegate_activation,
reexports::client::protocol::{wl_seat::WlSeat, wl_surface::WlSurface}, reexports::client::protocol::{wl_seat::WlSeat, wl_surface::WlSurface},
}; };
use iced_futures::futures::channel::oneshot::Sender;
use crate::platform_specific::wayland::event_loop::state::SctkState; use crate::platform_specific::wayland::event_loop::state::SctkState;

View file

@ -18,7 +18,7 @@ impl SeatHandler for SctkState {
fn new_seat( fn new_seat(
&mut self, &mut self,
_conn: &cctk::sctk::reexports::client::Connection, _conn: &cctk::sctk::reexports::client::Connection,
qh: &cctk::sctk::reexports::client::QueueHandle<Self>, _qh: &cctk::sctk::reexports::client::QueueHandle<Self>,
seat: cctk::sctk::reexports::client::protocol::wl_seat::WlSeat, seat: cctk::sctk::reexports::client::protocol::wl_seat::WlSeat,
) { ) {
self.sctk_events.push(SctkEvent::SeatEvent { self.sctk_events.push(SctkEvent::SeatEvent {

View file

@ -1,17 +1,13 @@
use cctk::{sctk, cosmic_protocols::{ use cctk::{sctk, cosmic_protocols::corner_radius::v1::client::{
corner_radius::v1::client::{
cosmic_corner_radius_manager_v1::CosmicCornerRadiusManagerV1, cosmic_corner_radius_manager_v1::CosmicCornerRadiusManagerV1,
cosmic_corner_radius_toplevel_v1::CosmicCornerRadiusToplevelV1, cosmic_corner_radius_toplevel_v1::CosmicCornerRadiusToplevelV1,
}, }};
overlap_notify::v1::client::zcosmic_overlap_notification_v1::ZcosmicOverlapNotificationV1,
}};
use sctk::reexports::{ use sctk::reexports::{
client::{Connection, Dispatch, Proxy}, client::{Connection, Dispatch, Proxy},
}; };
use crate::event_loop::state::SctkState; use crate::event_loop::state::SctkState;
use crate::platform_specific::wayland::SctkEvent;
impl Dispatch<CosmicCornerRadiusManagerV1, ()> for SctkState { impl Dispatch<CosmicCornerRadiusManagerV1, ()> for SctkState {
fn event( fn event(
@ -31,7 +27,7 @@ impl
> for SctkState > for SctkState
{ {
fn event( fn event(
state: &mut Self, _state: &mut Self,
_proxy: &CosmicCornerRadiusToplevelV1, _proxy: &CosmicCornerRadiusToplevelV1,
event: <CosmicCornerRadiusToplevelV1 as Proxy>::Event, event: <CosmicCornerRadiusToplevelV1 as Proxy>::Event,
_data: &(), _data: &(),

View file

@ -18,7 +18,7 @@ use cursor_icon::CursorIcon;
use iced_futures::futures::channel::mpsc; use iced_futures::futures::channel::mpsc;
use iced_graphics::{Compositor, compositor}; use iced_graphics::{Compositor, compositor};
use iced_runtime::core::{Vector, window}; use iced_runtime::core::{Vector, window};
use raw_window_handle::{DisplayHandle, HasDisplayHandle, HasWindowHandle}; use raw_window_handle::{HasDisplayHandle, HasWindowHandle};
use raw_window_handle::{HasRawDisplayHandle, RawWindowHandle}; use raw_window_handle::{HasRawDisplayHandle, RawWindowHandle};
use sctk_event::SctkEvent; use sctk_event::SctkEvent;
use std::{collections::HashMap, sync::Arc}; use std::{collections::HashMap, sync::Arc};
@ -189,12 +189,12 @@ impl WaylandSpecific {
winit_event_sender, winit_event_sender,
proxy, proxy,
sender, sender,
display_handle, display_handle: _,
conn, conn: _,
surface_ids, surface_ids,
modifiers, modifiers,
subsurface_state, subsurface_state,
surface_subsurfaces, surface_subsurfaces: _,
} = self; } = self;
match e { match e {
@ -237,7 +237,7 @@ impl WaylandSpecific {
&mut self, &mut self,
keep: F, keep: F,
) { ) {
self.surface_subsurfaces.retain(|k, v| keep(*k)) self.surface_subsurfaces.retain(|k, _v| keep(*k))
} }
pub(crate) fn clear_subsurface_list(&mut self) { pub(crate) fn clear_subsurface_list(&mut self) {
@ -250,7 +250,7 @@ impl WaylandSpecific {
wl_surface: &WlSurface, wl_surface: &WlSurface,
) { ) {
let subsurfaces = crate::subsurface_widget::take_subsurfaces(); let subsurfaces = crate::subsurface_widget::take_subsurfaces();
let mut entry = self.surface_subsurfaces.entry(id); let entry = self.surface_subsurfaces.entry(id);
let surface_subsurfaces = entry.or_default(); let surface_subsurfaces = entry.or_default();
let Some(subsurface_state) = self.subsurface_state.as_mut() else { let Some(subsurface_state) = self.subsurface_state.as_mut() else {
return; return;

View file

@ -4,7 +4,7 @@ use crate::{
SurfaceIdWrapper, UserInterfaces, SurfaceIdWrapper, UserInterfaces,
wayland::{ wayland::{
conversion::{ conversion::{
modifiers_to_native, pointer_axis_to_native, modifiers_to_native,
pointer_button_to_native, pointer_button_to_native,
}, },
keymap::{self, keysym_to_key}, keymap::{self, keysym_to_key},
@ -25,7 +25,6 @@ use iced_futures::{
}, },
}, },
}, },
event,
futures::{SinkExt, channel::mpsc}, futures::{SinkExt, channel::mpsc},
}; };
use iced_graphics::{Compositor, compositor}; use iced_graphics::{Compositor, compositor};
@ -40,9 +39,7 @@ use iced_runtime::{
user_interface, user_interface,
}; };
use cctk::{ use cctk::sctk::{
cosmic_protocols::overlap_notify::v1::client::zcosmic_overlap_notification_v1,
sctk::{
output::OutputInfo, output::OutputInfo,
reexports::{ reexports::{
calloop::channel, calloop::channel,
@ -67,11 +64,8 @@ use cctk::{
wlr_layer::{Layer, LayerSurfaceConfigure}, wlr_layer::{Layer, LayerSurfaceConfigure},
xdg::{popup::PopupConfigure, window::WindowConfigure}, xdg::{popup::PopupConfigure, window::WindowConfigure},
}, },
}, };
wayland_client::protocol::wl_subsurface::WlSubsurface,
};
use std::{ use std::{
any::Any,
collections::HashMap, collections::HashMap,
num::NonZeroU32, num::NonZeroU32,
sync::{Arc, Mutex}, sync::{Arc, Mutex},
@ -510,7 +504,7 @@ impl SctkEvent {
), ),
), ),
), ),
SurfaceIdWrapper::Window(id) => { SurfaceIdWrapper::Window(_id) => {
Some(iced_runtime::core::Event::Window( Some(iced_runtime::core::Event::Window(
window::Event::Unfocused, window::Event::Unfocused,
)) ))
@ -538,7 +532,7 @@ impl SctkEvent {
), ),
), ),
), ),
SurfaceIdWrapper::Subsurface(id) => None, SurfaceIdWrapper::Subsurface(_id) => None,
}) })
{ {
events.push(( events.push((
@ -572,7 +566,7 @@ impl SctkEvent {
), ),
), ),
), ),
SurfaceIdWrapper::Window(id) => { SurfaceIdWrapper::Window(_id) => {
Some(iced_runtime::core::Event::Window( Some(iced_runtime::core::Event::Window(
window::Event::Focused, window::Event::Focused,
)) ))

View file

@ -58,9 +58,7 @@ use wayland_protocols::wp::{
}; };
use winit::window::WindowId; use winit::window::WindowId;
use crate::platform_specific::{ use crate::platform_specific::event_loop::state::SctkState;
SurfaceIdWrapper, event_loop::state::SctkState,
};
#[derive(Debug)] #[derive(Debug)]
pub struct Plane { pub struct Plane {

View file

@ -1,9 +1,9 @@
use crate::platform_specific::wayland::Action; use crate::platform_specific::wayland::Action;
use cctk::sctk::reexports::{ use cctk::sctk::reexports::{
calloop::{LoopHandle, channel}, calloop::channel,
client::{ client::{
Proxy, QueueHandle, Proxy, QueueHandle,
protocol::{wl_display::WlDisplay, wl_surface::WlSurface}, protocol::wl_display::WlDisplay,
}, },
}; };
use raw_window_handle::HandleError; use raw_window_handle::HandleError;
@ -91,7 +91,7 @@ impl winit::window::Window for SctkWinitWindow {
} }
} }
fn set_cursor_visible(&self, visible: bool) { fn set_cursor_visible(&self, _visible: bool) {
// TODO // TODO
} }
@ -203,35 +203,35 @@ impl winit::window::Window for SctkWinitWindow {
// TODO refer to winit for implementation // TODO refer to winit for implementation
} }
fn set_outer_position(&self, position: winit::dpi::Position) {} fn set_outer_position(&self, _position: winit::dpi::Position) {}
fn outer_size(&self) -> winit::dpi::PhysicalSize<u32> { fn outer_size(&self) -> winit::dpi::PhysicalSize<u32> {
// XXX not applicable to wrapped surfaces // XXX not applicable to wrapped surfaces
Default::default() Default::default()
} }
fn set_min_surface_size(&self, min_size: Option<winit::dpi::Size>) { fn set_min_surface_size(&self, _min_size: Option<winit::dpi::Size>) {
// XXX not applicable to wrapped surfaces // XXX not applicable to wrapped surfaces
} }
fn set_max_surface_size(&self, max_size: Option<winit::dpi::Size>) { fn set_max_surface_size(&self, _max_size: Option<winit::dpi::Size>) {
// XXX not applicable to wrapped surfaces // XXX not applicable to wrapped surfaces
} }
fn set_surface_resize_increments( fn set_surface_resize_increments(
&self, &self,
increments: Option<winit::dpi::Size>, _increments: Option<winit::dpi::Size>,
) { ) {
log::warn!( log::warn!(
"`set_surface_resize_increments` is not implemented for Wayland" "`set_surface_resize_increments` is not implemented for Wayland"
) )
} }
fn set_title(&self, title: &str) { fn set_title(&self, _title: &str) {
// XXX not applicable to wrapped surfaces // XXX not applicable to wrapped surfaces
} }
fn set_transparent(&self, transparent: bool) { fn set_transparent(&self, _transparent: bool) {
todo!() todo!()
} }
@ -286,23 +286,23 @@ impl winit::window::Window for SctkWinitWindow {
_ = self.tx.send(Action::SetImePurpose(purpose)); _ = self.tx.send(Action::SetImePurpose(purpose));
} }
fn set_blur(&self, blur: bool) { fn set_blur(&self, _blur: bool) {
// TODO // TODO
} }
fn set_visible(&self, visible: bool) {} fn set_visible(&self, _visible: bool) {}
fn is_visible(&self) -> Option<bool> { fn is_visible(&self) -> Option<bool> {
None None
} }
fn set_resizable(&self, resizable: bool) {} fn set_resizable(&self, _resizable: bool) {}
fn is_resizable(&self) -> bool { fn is_resizable(&self) -> bool {
false false
} }
fn set_enabled_buttons(&self, buttons: winit::window::WindowButtons) { fn set_enabled_buttons(&self, _buttons: winit::window::WindowButtons) {
// TODO v5 of xdg_shell. // TODO v5 of xdg_shell.
} }
@ -310,7 +310,7 @@ impl winit::window::Window for SctkWinitWindow {
WindowButtons::all() WindowButtons::all()
} }
fn set_minimized(&self, minimized: bool) { fn set_minimized(&self, _minimized: bool) {
// XXX not applicable to the wrapped surfaces // XXX not applicable to the wrapped surfaces
} }
@ -319,7 +319,7 @@ impl winit::window::Window for SctkWinitWindow {
None None
} }
fn set_maximized(&self, maximized: bool) { fn set_maximized(&self, _maximized: bool) {
// XXX can't minimize the wrapped surfaces // XXX can't minimize the wrapped surfaces
} }
@ -330,7 +330,7 @@ impl winit::window::Window for SctkWinitWindow {
fn set_fullscreen( fn set_fullscreen(
&self, &self,
fullscreen: Option<winit_core::monitor::Fullscreen>, _fullscreen: Option<winit_core::monitor::Fullscreen>,
) { ) {
// XXX can't fullscreen the wrapped surfaces // XXX can't fullscreen the wrapped surfaces
} }
@ -340,7 +340,7 @@ impl winit::window::Window for SctkWinitWindow {
None None
} }
fn set_decorations(&self, decorations: bool) { fn set_decorations(&self, _decorations: bool) {
// XXX no decorations supported for the wrapped surfaces // XXX no decorations supported for the wrapped surfaces
} }
@ -348,26 +348,26 @@ impl winit::window::Window for SctkWinitWindow {
false false
} }
fn set_window_level(&self, level: winit::window::WindowLevel) {} fn set_window_level(&self, _level: winit::window::WindowLevel) {}
fn set_window_icon(&self, window_icon: Option<winit_core::icon::Icon>) {} fn set_window_icon(&self, _window_icon: Option<winit_core::icon::Icon>) {}
fn focus_window(&self) {} fn focus_window(&self) {}
fn request_user_attention( fn request_user_attention(
&self, &self,
request_type: Option<winit::window::UserAttentionType>, _request_type: Option<winit::window::UserAttentionType>,
) { ) {
// XXX can't request attention on wrapped surfaces // XXX can't request attention on wrapped surfaces
} }
fn set_theme(&self, theme: Option<winit::window::Theme>) {} fn set_theme(&self, _theme: Option<winit::window::Theme>) {}
fn theme(&self) -> Option<winit::window::Theme> { fn theme(&self) -> Option<winit::window::Theme> {
None None
} }
fn set_content_protected(&self, protected: bool) {} fn set_content_protected(&self, _protected: bool) {}
fn title(&self) -> String { fn title(&self) -> String {
String::new() String::new()
@ -420,14 +420,14 @@ impl winit::window::Window for SctkWinitWindow {
fn set_cursor_position( fn set_cursor_position(
&self, &self,
position: winit::dpi::Position, _position: winit::dpi::Position,
) -> Result<(), winit::error::RequestError> { ) -> Result<(), winit::error::RequestError> {
todo!() todo!()
} }
fn set_cursor_grab( fn set_cursor_grab(
&self, &self,
mode: winit::window::CursorGrabMode, _mode: winit::window::CursorGrabMode,
) -> Result<(), winit::error::RequestError> { ) -> Result<(), winit::error::RequestError> {
todo!() todo!()
} }
@ -438,7 +438,7 @@ impl winit::window::Window for SctkWinitWindow {
fn request_ime_update( fn request_ime_update(
&self, &self,
request: winit::window::ImeRequest, _request: winit::window::ImeRequest,
) -> Result<(), winit::window::ImeRequestError> { ) -> Result<(), winit::window::ImeRequestError> {
todo!() todo!()
} }

View file

@ -8,7 +8,6 @@ use crate::futures::futures::{
use crate::graphics::shell; use crate::graphics::shell;
use crate::runtime::Action; use crate::runtime::Action;
use crate::runtime::window; use crate::runtime::window;
use std::hash::DefaultHasher;
use std::pin::Pin; use std::pin::Pin;
/// An event loop proxy with backpressure that implements `Sink`. /// An event loop proxy with backpressure that implements `Sink`.