diff --git a/core/src/element.rs b/core/src/element.rs index f97ed6bc..dbe449c5 100644 --- a/core/src/element.rs +++ b/core/src/element.rs @@ -1,4 +1,4 @@ -use crate::event::{self, Event}; +use crate::event::Event; use crate::id::Id; use crate::layout; use crate::mouse; diff --git a/core/src/overlay/group.rs b/core/src/overlay/group.rs index ec0906e7..1a4ce672 100644 --- a/core/src/overlay/group.rs +++ b/core/src/overlay/group.rs @@ -3,7 +3,7 @@ use crate::mouse; use crate::overlay; use crate::renderer; 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`] /// children. diff --git a/core/src/widget/operation/search_id.rs b/core/src/widget/operation/search_id.rs index 1286abaf..e03fac8a 100644 --- a/core/src/widget/operation/search_id.rs +++ b/core/src/widget/operation/search_id.rs @@ -4,7 +4,7 @@ use super::Operation; use crate::{ Rectangle, id::Id, - widget::operation::{Outcome, focusable::Count}, + widget::operation::Outcome, }; /// Produces an [`Operation`] that searches for the Id diff --git a/core/src/widget/text.rs b/core/src/widget/text.rs index 1e40bf9e..19e76761 100644 --- a/core/src/widget/text.rs +++ b/core/src/widget/text.rs @@ -25,13 +25,12 @@ use crate::layout; use crate::mouse; use crate::renderer; use crate::text::paragraph::{self, Paragraph}; -use crate::text::{self, Fragment}; +use crate::text::{self}; use crate::widget::tree::{self, Tree}; use crate::{ Color, Element, Layout, Length, Pixels, Rectangle, Size, Theme, Widget, }; -use std::borrow::Cow; pub use text::{Alignment, Ellipsize, LineHeight, Shaping, Wrapping}; /// A bunch of text. diff --git a/graphics/src/image.rs b/graphics/src/image.rs index e5fe9281..d9b23216 100644 --- a/graphics/src/image.rs +++ b/graphics/src/image.rs @@ -2,8 +2,6 @@ #[cfg(feature = "image")] use crate::core::Bytes; -use crate::core::Color; -use crate::core::Radians; use crate::core::Rectangle; use crate::core::image; use crate::core::svg; diff --git a/runtime/src/dnd.rs b/runtime/src/dnd.rs index e6f2b267..446bee68 100644 --- a/runtime/src/dnd.rs +++ b/runtime/src/dnd.rs @@ -1,10 +1,8 @@ //! Access the clipboard. -use std::any::Any; use dnd::{DndDestinationRectangle, DndSurface}; -use iced_core::clipboard::DndSource; -use window_clipboard::mime::{AllowedMimeTypes, AsMimeTypes}; +use window_clipboard::mime::AllowedMimeTypes; use crate::{oneshot, task, Action, Task}; diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 22da3d66..68034bfc 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -28,7 +28,6 @@ pub use task::Task; pub use user_interface::UserInterface; pub use window::Window; -use crate::core::Color; use crate::futures::futures::channel::oneshot; use std::borrow::Cow; diff --git a/runtime/src/platform_specific/wayland/popup.rs b/runtime/src/platform_specific/wayland/popup.rs index e0475eb8..d186f5f0 100644 --- a/runtime/src/platform_specific/wayland/popup.rs +++ b/runtime/src/platform_specific/wayland/popup.rs @@ -1,14 +1,12 @@ -use std::any::Any; use std::fmt; use std::hash::{Hash, Hasher}; -use std::sync::Arc; use cctk::sctk::reexports::protocols::xdg::shell::client::xdg_positioner::{ Anchor, Gravity, }; use iced_core::layout::Limits; use iced_core::window::Id; -use iced_core::{Element, Rectangle}; +use iced_core::Rectangle; /// Popup creation details #[derive(Debug, Clone)] diff --git a/runtime/src/platform_specific/wayland/subsurface.rs b/runtime/src/platform_specific/wayland/subsurface.rs index f174b0a5..13ae6da2 100644 --- a/runtime/src/platform_specific/wayland/subsurface.rs +++ b/runtime/src/platform_specific/wayland/subsurface.rs @@ -1,14 +1,9 @@ -use std::any::Any; use std::fmt; use std::hash::{Hash, Hasher}; -use std::sync::Arc; -use cctk::sctk::reexports::protocols::xdg::shell::client::xdg_positioner::{ - Anchor, Gravity, -}; -use iced_core::layout::Limits; +use cctk::sctk::reexports::protocols::xdg::shell::client::xdg_positioner::Gravity; use iced_core::window::Id; -use iced_core::{Element, Point, Rectangle, Size}; +use iced_core::{Point, Rectangle, Size}; /// Subsurface creation details #[derive(Debug, Clone)] diff --git a/tiny_skia/src/raster.rs b/tiny_skia/src/raster.rs index 7c820917..cf508c9c 100644 --- a/tiny_skia/src/raster.rs +++ b/tiny_skia/src/raster.rs @@ -57,7 +57,7 @@ impl Pipeline { let width_scale = bounds.width / image.width() 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::Nearest => tiny_skia::FilterQuality::Nearest, }; diff --git a/wgpu/src/layer.rs b/wgpu/src/layer.rs index d4a96ef8..c61730b6 100644 --- a/wgpu/src/layer.rs +++ b/wgpu/src/layer.rs @@ -1,4 +1,3 @@ -use crate::core::Radians; use crate::core::{ self, Background, Color, Point, Rectangle, Svg, Transformation, renderer, }; diff --git a/wgpu/src/lib.rs b/wgpu/src/lib.rs index 4eb52cc8..830f9911 100644 --- a/wgpu/src/lib.rs +++ b/wgpu/src/lib.rs @@ -64,8 +64,8 @@ pub use geometry::Geometry; use crate::core::renderer; use crate::core::{ - Background, Color, Font, Pixels, Point, Radians, Rectangle, Size, - Transformation, Vector, image::FilterMethod, + Background, Color, Font, Pixels, Point, Rectangle, Size, + Transformation, Vector, }; use crate::graphics::mesh; use crate::graphics::text::{Editor, Paragraph}; diff --git a/wgpu/src/window/compositor.rs b/wgpu/src/window/compositor.rs index 15a13905..56c01980 100644 --- a/wgpu/src/window/compositor.rs +++ b/wgpu/src/window/compositor.rs @@ -18,7 +18,6 @@ use crate::{Engine, Renderer}; use super::wayland::get_wayland_device_ids; #[cfg(all(unix, feature = "x11", not(target_os = "macos"), not(target_os = "redox")))] use super::x11::get_x11_device_ids; -use std::future::Future; /// A window graphics backend for iced powered by `wgpu`. pub struct Compositor { diff --git a/widget/src/button.rs b/widget/src/button.rs index f137221e..ed7f6ea9 100644 --- a/widget/src/button.rs +++ b/widget/src/button.rs @@ -599,7 +599,7 @@ where (x + width) as f64, (y + height) as f64, ); - let is_hovered = state.state.downcast_ref::().is_hovered; + let _is_hovered = state.state.downcast_ref::().is_hovered; let mut node = Node::new(Role::Button); node.add_action(Action::Focus); diff --git a/widget/src/checkbox.rs b/widget/src/checkbox.rs index 873a4541..83960569 100644 --- a/widget/src/checkbox.rs +++ b/widget/src/checkbox.rs @@ -536,7 +536,7 @@ where }; let bounds = layout.bounds(); - let is_hovered = cursor.is_over(bounds); + let _is_hovered = cursor.is_over(bounds); let Rectangle { x, y, diff --git a/widget/src/container.rs b/widget/src/container.rs index e4aeabf2..a264007a 100644 --- a/widget/src/container.rs +++ b/widget/src/container.rs @@ -35,7 +35,7 @@ use crate::core::{ color, }; -use iced_runtime::{Action, Task, task}; +use iced_runtime::{Task, task}; /// A widget that aligns its contents inside of its boundaries. /// diff --git a/widget/src/image.rs b/widget/src/image.rs index 4315709a..d726eeec 100644 --- a/widget/src/image.rs +++ b/widget/src/image.rs @@ -293,8 +293,8 @@ fn drawing_bounds( content_fit: ContentFit, rotation: Rotation, scale: f32, - opacity: f32, - border_radius: [f32; 4], + _opacity: f32, + _border_radius: [f32; 4], ) -> Rectangle where Renderer: image::Renderer, diff --git a/widget/src/keyed/column.rs b/widget/src/keyed/column.rs index baaee5c9..f3e33142 100644 --- a/widget/src/keyed/column.rs +++ b/widget/src/keyed/column.rs @@ -1,7 +1,6 @@ //! Keyed columns distribute content vertically while keeping continuity. //! Distribute content vertically. -use crate::core::event; use crate::core::layout; use crate::core::mouse; use crate::core::overlay; diff --git a/widget/src/lazy.rs b/widget/src/lazy.rs index 7a1f8506..7a2611ee 100644 --- a/widget/src/lazy.rs +++ b/widget/src/lazy.rs @@ -15,7 +15,7 @@ use crate::core::mouse; use crate::core::overlay; use crate::core::renderer; use crate::core::widget::tree::{self, Tree}; -use crate::core::widget::{self, Widget}; +use crate::core::widget::Widget; use crate::core::{ self, Clipboard, Event, Length, Rectangle, Shell, Size, Vector, }; diff --git a/widget/src/lazy/component.rs b/widget/src/lazy/component.rs index a810e117..682fd458 100644 --- a/widget/src/lazy/component.rs +++ b/widget/src/lazy/component.rs @@ -527,11 +527,11 @@ where renderer: &Renderer, dnd_rectangles: &mut core::clipboard::DndDestinationRectangles, ) { - let mut tree = tree + let tree = tree .state .downcast_ref::>>>() .borrow_mut(); - let mut tree = tree.as_ref().unwrap(); + let tree = tree.as_ref().unwrap(); self.with_element(|element| { element.as_widget().drag_destinations( &tree.children[0], diff --git a/widget/src/list.rs b/widget/src/list.rs index 6b5f663f..d0d501d2 100644 --- a/widget/src/list.rs +++ b/widget/src/list.rs @@ -1,5 +1,5 @@ #![allow(missing_docs)] -use crate::core::event::{self, Event}; +use crate::core::event::Event; use crate::core::layout; use crate::core::mouse; use crate::core::overlay; diff --git a/widget/src/mouse_area.rs b/widget/src/mouse_area.rs index 3d355c52..4d808348 100644 --- a/widget/src/mouse_area.rs +++ b/widget/src/mouse_area.rs @@ -2,7 +2,6 @@ use iced_renderer::core::mouse::Click; -use crate::core::event; use crate::core::layout; use crate::core::mouse; use crate::core::overlay; diff --git a/widget/src/pane_grid/content.rs b/widget/src/pane_grid/content.rs index a76010e7..4c41e3a6 100644 --- a/widget/src/pane_grid/content.rs +++ b/widget/src/pane_grid/content.rs @@ -6,7 +6,7 @@ use crate::core::renderer; use crate::core::widget::{self, Tree}; use crate::core::{ self, Clipboard, Element, Event, Layout, Point, Rectangle, Shell, Size, - Vector, event, + Vector, }; use crate::pane_grid::{Draggable, TitleBar}; diff --git a/widget/src/scrollable.rs b/widget/src/scrollable.rs index e005a7b8..b14e1413 100644 --- a/widget/src/scrollable.rs +++ b/widget/src/scrollable.rs @@ -27,7 +27,6 @@ use iced_runtime::core::widget::Id; #[cfg(feature = "a11y")] use std::borrow::Cow; -use crate::core::event; use crate::core::keyboard; use crate::core::layout; use crate::core::mouse; @@ -933,7 +932,7 @@ where 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( id, dnd::OfferEvent::Enter { @@ -1586,7 +1585,7 @@ where return A11yTree::default(); } let window = layout.bounds(); - let is_hovered = cursor.is_over(window); + let _is_hovered = cursor.is_over(window); let Rectangle { x, y, @@ -1670,7 +1669,7 @@ where })) { let scrollbar_bounds = scrollbar.total_bounds; - let is_hovered = cursor.is_over(scrollbar_bounds); + let _is_hovered = cursor.is_over(scrollbar_bounds); let Rectangle { x, y, diff --git a/widget/src/slider.rs b/widget/src/slider.rs index ff32f417..e3fe484a 100644 --- a/widget/src/slider.rs +++ b/widget/src/slider.rs @@ -695,7 +695,7 @@ where }; let bounds = layout.bounds(); - let is_hovered = cursor.is_over(bounds); + let _is_hovered = cursor.is_over(bounds); let Rectangle { x, y, diff --git a/widget/src/stack.rs b/widget/src/stack.rs index e85bf2af..cd30a886 100644 --- a/widget/src/stack.rs +++ b/widget/src/stack.rs @@ -1,6 +1,5 @@ //! Display content on top of other content. -use crate::core::event; use crate::core::layout; use crate::core::mouse; use crate::core::overlay; diff --git a/widget/src/svg.rs b/widget/src/svg.rs index 277af3eb..61b1e688 100644 --- a/widget/src/svg.rs +++ b/widget/src/svg.rs @@ -31,7 +31,6 @@ use crate::core::{ #[cfg(feature = "a11y")] use std::borrow::Cow; -use std::marker::PhantomData; use std::path::PathBuf; pub use crate::core::svg::Handle; diff --git a/widget/src/themer.rs b/widget/src/themer.rs index 306c8580..76448ae1 100644 --- a/widget/src/themer.rs +++ b/widget/src/themer.rs @@ -1,6 +1,5 @@ use crate::container; -use crate::core::event; use crate::core::layout; use crate::core::mouse; use crate::core::overlay; diff --git a/widget/src/toggler.rs b/widget/src/toggler.rs index d398a79b..43ba6930 100644 --- a/widget/src/toggler.rs +++ b/widget/src/toggler.rs @@ -37,7 +37,6 @@ use std::borrow::Cow; use iced_runtime::core::border::Radius; use crate::core::alignment; -use crate::core::border; use crate::core::layout; use crate::core::mouse; use crate::core::renderer; @@ -509,7 +508,7 @@ where let space = style.handle_margin; - let toggler_background_bounds = Rectangle { + let _toggler_background_bounds = Rectangle { x: bounds.x, y: bounds.y, width: bounds.width, @@ -529,7 +528,7 @@ where style.background, ); - let padding = (style.padding_ratio * bounds.height).round(); + let _padding = (style.padding_ratio * bounds.height).round(); let toggler_foreground_bounds = Rectangle { x: bounds.x + if self.is_toggled { @@ -570,7 +569,7 @@ where }; let bounds = layout.bounds(); - let is_hovered = cursor.is_over(bounds); + let _is_hovered = cursor.is_over(bounds); let Rectangle { x, y, diff --git a/winit/src/a11y.rs b/winit/src/a11y.rs index a901b480..61fbe630 100644 --- a/winit/src/a11y.rs +++ b/winit/src/a11y.rs @@ -4,7 +4,6 @@ use crate::futures::futures::channel::mpsc; use iced_accessibility::accesskit::{ ActivationHandler, Node, NodeId, Role, Tree, TreeId, TreeUpdate, }; -use iced_accessibility::accesskit_winit::Adapter; use iced_runtime::core; pub struct WinitActivationHandler { diff --git a/winit/src/application/drag_resize.rs b/winit/src/application/drag_resize.rs index 6d575b52..5e524736 100644 --- a/winit/src/application/drag_resize.rs +++ b/winit/src/application/drag_resize.rs @@ -25,7 +25,7 @@ const DRAG_RESIZE_SUPPORTED: bool = false; /// If supported by winit, returns a closure that implements cursor resize support. pub fn event_func( - window: &dyn winit::window::Window, + _window: &dyn winit::window::Window, border_size: f64, ) -> Option< Box< diff --git a/winit/src/clipboard.rs b/winit/src/clipboard.rs index d302ac36..da83d37a 100644 --- a/winit/src/clipboard.rs +++ b/winit/src/clipboard.rs @@ -1,7 +1,7 @@ //! Access the clipboard. use std::sync::Mutex; -use std::{any::Any, borrow::Cow}; +use std::borrow::Cow; use crate::Control; diff --git a/winit/src/conversion.rs b/winit/src/conversion.rs index fcb73c39..0afb8e72 100644 --- a/winit/src/conversion.rs +++ b/winit/src/conversion.rs @@ -3,7 +3,6 @@ //! [`winit`]: https://github.com/rust-windowing/winit //! [`iced_runtime`]: https://github.com/iced-rs/iced/tree/0.14/runtime use crate::core::input_method; -use std::hash::DefaultHasher; use std::hash::Hash; use std::hash::Hasher; use std::sync::Arc; @@ -14,7 +13,6 @@ use crate::core::theme; use crate::core::touch; use crate::core::window; use crate::core::{Event, Point, Size}; -use iced_futures::core::event::PlatformSpecific; use winit::dpi::PhysicalPosition; use winit::event::ButtonSource; use winit::event::ElementState; @@ -27,7 +25,7 @@ use winit::keyboard::SmolStr; pub fn window_attributes( settings: window::Settings, title: &str, - scale_factor: f64, + _scale_factor: f64, primary_monitor: Option, _id: Option, ) -> winit::window::WindowAttributes { @@ -396,8 +394,8 @@ pub fn window_event( Ime::Commit(content) => input_method::Event::Commit(content), Ime::Disabled => input_method::Event::Closed, Ime::DeleteSurrounding { - before_bytes, - after_bytes, + before_bytes: _, + after_bytes: _, } => todo!(), })), WindowEvent::Focused(focused) => Some(Event::Window(if focused { @@ -411,7 +409,7 @@ pub fn window_event( WindowEvent::DragDropped { paths, .. } => { Some(Event::Window(window::Event::FileDropped(paths.clone()))) } - WindowEvent::DragLeft { position } => { + WindowEvent::DragLeft { position: _ } => { Some(Event::Window(window::Event::FilesHoveredLeft)) } @@ -707,7 +705,7 @@ enum TouchInternal { pub fn touch_event( finger: FingerId, state: TouchInternal, - force: Option, + _force: Option, position: Option>, scale_factor: f64, ) -> touch::Event { diff --git a/winit/src/lib.rs b/winit/src/lib.rs index 735d73aa..5b5d1ce1 100644 --- a/winit/src/lib.rs +++ b/winit/src/lib.rs @@ -53,7 +53,6 @@ mod window; pub use clipboard::Clipboard; pub use error::Error; pub use proxy::Proxy; -use winit::dpi::LogicalSize; use winit::dpi::PhysicalPosition; use winit::dpi::PhysicalSize; @@ -322,9 +321,9 @@ where // create initial window let Some(BootConfig { sender, - fonts, - graphics_settings, - is_wayland, + fonts: _, + graphics_settings: _, + is_wayland: _, }) = self.boot.take() else { return; @@ -636,10 +635,7 @@ where #[cfg(feature = "a11y")] fn init_adapter(&mut self, event_loop: &(dyn winit::event_loop::ActiveEventLoop + 'static), id: core::window::Id, window: Arc) { use crate::a11y::*; - use iced_accessibility::accesskit::{ - ActivationHandler, Node, NodeId, Role, - Tree, TreeUpdate, - }; + use iced_accessibility::accesskit_winit::Adapter; let node_id = diff --git a/winit/src/platform_specific/mod.rs b/winit/src/platform_specific/mod.rs index 5e84d16a..66eda20c 100644 --- a/winit/src/platform_specific/mod.rs +++ b/winit/src/platform_specific/mod.rs @@ -1,14 +1,11 @@ //! 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_runtime::{ - core::{Vector, window}, - platform_specific, user_interface, + core::{Vector, window}, user_interface, }; use winit::raw_window_handle::HasWindowHandle; @@ -17,8 +14,6 @@ pub mod wayland; #[cfg(all(feature = "cctk", target_os = "linux"))] pub use wayland::*; -#[cfg(all(feature = "cctk", target_os = "linux"))] -use wayland_backend::client::Backend; use crate::{CreateCompositor, Program, WindowManager}; diff --git a/winit/src/platform_specific/wayland/event_loop/mod.rs b/winit/src/platform_specific/wayland/event_loop/mod.rs index 6c63f218..87d00ec2 100644 --- a/winit/src/platform_specific/wayland/event_loop/mod.rs +++ b/winit/src/platform_specific/wayland/event_loop/mod.rs @@ -2,8 +2,6 @@ pub mod control_flow; pub mod proxy; pub mod state; -#[cfg(feature = "a11y")] -use crate::platform_specific::SurfaceIdWrapper; use crate::{ Control, futures::futures::channel::mpsc, @@ -43,8 +41,6 @@ use cctk::{ }; use raw_window_handle::HasDisplayHandle; use state::{FrameStatus, SctkWindow, send_event}; -#[cfg(feature = "a11y")] -use std::sync::{Arc, Mutex}; use std::{ collections::{HashMap, HashSet}, fmt::Debug, diff --git a/winit/src/platform_specific/wayland/event_loop/state.rs b/winit/src/platform_specific/wayland/event_loop/state.rs index 9c9a4e11..3d93a015 100644 --- a/winit/src/platform_specific/wayland/event_loop/state.rs +++ b/winit/src/platform_specific/wayland/event_loop/state.rs @@ -29,7 +29,6 @@ use std::{ convert::Infallible, fmt::Debug, sync::{Arc, Mutex, atomic::AtomicU32}, - thread::panicking, time::Duration, }; use wayland_backend::client::ObjectId; @@ -50,7 +49,6 @@ use cctk::{ activation::{ActivationState, RequestData}, compositor::CompositorState, error::GlobalError, - globals::GlobalData, output::OutputState, reexports::{ 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 queue_handle = self.queue_handle.clone(); _ = 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; }; @@ -1574,7 +1572,7 @@ impl SctkState { if let Some(manager) = self.corner_radius_manager.as_ref() { if let Some(w) = self.windows.iter_mut().find(|w| w.id == id) { let geo_size: LogicalSize = w.window.surface_size().cast::().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 { let adjusted_radii = CornerRadius { diff --git a/winit/src/platform_specific/wayland/handlers/activation.rs b/winit/src/platform_specific/wayland/handlers/activation.rs index 6b03a8dd..ed5f2259 100644 --- a/winit/src/platform_specific/wayland/handlers/activation.rs +++ b/winit/src/platform_specific/wayland/handlers/activation.rs @@ -3,7 +3,6 @@ use cctk::sctk::{ delegate_activation, 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; diff --git a/winit/src/platform_specific/wayland/handlers/seat/seat.rs b/winit/src/platform_specific/wayland/handlers/seat/seat.rs index 2901ce8e..b0fe43f4 100644 --- a/winit/src/platform_specific/wayland/handlers/seat/seat.rs +++ b/winit/src/platform_specific/wayland/handlers/seat/seat.rs @@ -18,7 +18,7 @@ impl SeatHandler for SctkState { fn new_seat( &mut self, _conn: &cctk::sctk::reexports::client::Connection, - qh: &cctk::sctk::reexports::client::QueueHandle, + _qh: &cctk::sctk::reexports::client::QueueHandle, seat: cctk::sctk::reexports::client::protocol::wl_seat::WlSeat, ) { self.sctk_events.push(SctkEvent::SeatEvent { diff --git a/winit/src/platform_specific/wayland/handlers/shell/corner_radius.rs b/winit/src/platform_specific/wayland/handlers/shell/corner_radius.rs index bd7d2409..67439671 100644 --- a/winit/src/platform_specific/wayland/handlers/shell/corner_radius.rs +++ b/winit/src/platform_specific/wayland/handlers/shell/corner_radius.rs @@ -1,17 +1,13 @@ -use cctk::{sctk, cosmic_protocols::{ - corner_radius::v1::client::{ +use cctk::{sctk, cosmic_protocols::corner_radius::v1::client::{ cosmic_corner_radius_manager_v1::CosmicCornerRadiusManagerV1, cosmic_corner_radius_toplevel_v1::CosmicCornerRadiusToplevelV1, - }, - overlap_notify::v1::client::zcosmic_overlap_notification_v1::ZcosmicOverlapNotificationV1, -}}; + }}; use sctk::reexports::{ client::{Connection, Dispatch, Proxy}, }; use crate::event_loop::state::SctkState; -use crate::platform_specific::wayland::SctkEvent; impl Dispatch for SctkState { fn event( @@ -31,7 +27,7 @@ impl > for SctkState { fn event( - state: &mut Self, + _state: &mut Self, _proxy: &CosmicCornerRadiusToplevelV1, event: ::Event, _data: &(), diff --git a/winit/src/platform_specific/wayland/mod.rs b/winit/src/platform_specific/wayland/mod.rs index 9b3a7ec0..321561da 100644 --- a/winit/src/platform_specific/wayland/mod.rs +++ b/winit/src/platform_specific/wayland/mod.rs @@ -18,7 +18,7 @@ use cursor_icon::CursorIcon; use iced_futures::futures::channel::mpsc; use iced_graphics::{Compositor, compositor}; 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 sctk_event::SctkEvent; use std::{collections::HashMap, sync::Arc}; @@ -189,12 +189,12 @@ impl WaylandSpecific { winit_event_sender, proxy, sender, - display_handle, - conn, + display_handle: _, + conn: _, surface_ids, modifiers, subsurface_state, - surface_subsurfaces, + surface_subsurfaces: _, } = self; match e { @@ -237,7 +237,7 @@ impl WaylandSpecific { &mut self, 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) { @@ -250,7 +250,7 @@ impl WaylandSpecific { wl_surface: &WlSurface, ) { 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 Some(subsurface_state) = self.subsurface_state.as_mut() else { return; diff --git a/winit/src/platform_specific/wayland/sctk_event.rs b/winit/src/platform_specific/wayland/sctk_event.rs index 3a1a0166..8c2b24df 100755 --- a/winit/src/platform_specific/wayland/sctk_event.rs +++ b/winit/src/platform_specific/wayland/sctk_event.rs @@ -4,7 +4,7 @@ use crate::{ SurfaceIdWrapper, UserInterfaces, wayland::{ conversion::{ - modifiers_to_native, pointer_axis_to_native, + modifiers_to_native, pointer_button_to_native, }, keymap::{self, keysym_to_key}, @@ -25,7 +25,6 @@ use iced_futures::{ }, }, }, - event, futures::{SinkExt, channel::mpsc}, }; use iced_graphics::{Compositor, compositor}; @@ -40,9 +39,7 @@ use iced_runtime::{ user_interface, }; -use cctk::{ - cosmic_protocols::overlap_notify::v1::client::zcosmic_overlap_notification_v1, - sctk::{ +use cctk::sctk::{ output::OutputInfo, reexports::{ calloop::channel, @@ -67,11 +64,8 @@ use cctk::{ wlr_layer::{Layer, LayerSurfaceConfigure}, xdg::{popup::PopupConfigure, window::WindowConfigure}, }, - }, - wayland_client::protocol::wl_subsurface::WlSubsurface, -}; + }; use std::{ - any::Any, collections::HashMap, num::NonZeroU32, sync::{Arc, Mutex}, @@ -510,7 +504,7 @@ impl SctkEvent { ), ), ), - SurfaceIdWrapper::Window(id) => { + SurfaceIdWrapper::Window(_id) => { Some(iced_runtime::core::Event::Window( window::Event::Unfocused, )) @@ -538,7 +532,7 @@ impl SctkEvent { ), ), ), - SurfaceIdWrapper::Subsurface(id) => None, + SurfaceIdWrapper::Subsurface(_id) => None, }) { events.push(( @@ -572,7 +566,7 @@ impl SctkEvent { ), ), ), - SurfaceIdWrapper::Window(id) => { + SurfaceIdWrapper::Window(_id) => { Some(iced_runtime::core::Event::Window( window::Event::Focused, )) diff --git a/winit/src/platform_specific/wayland/subsurface_widget.rs b/winit/src/platform_specific/wayland/subsurface_widget.rs index 15233009..7f15854b 100644 --- a/winit/src/platform_specific/wayland/subsurface_widget.rs +++ b/winit/src/platform_specific/wayland/subsurface_widget.rs @@ -58,9 +58,7 @@ use wayland_protocols::wp::{ }; use winit::window::WindowId; -use crate::platform_specific::{ - SurfaceIdWrapper, event_loop::state::SctkState, -}; +use crate::platform_specific::event_loop::state::SctkState; #[derive(Debug)] pub struct Plane { diff --git a/winit/src/platform_specific/wayland/winit_window.rs b/winit/src/platform_specific/wayland/winit_window.rs index 296d8b67..fd562a45 100644 --- a/winit/src/platform_specific/wayland/winit_window.rs +++ b/winit/src/platform_specific/wayland/winit_window.rs @@ -1,9 +1,9 @@ use crate::platform_specific::wayland::Action; use cctk::sctk::reexports::{ - calloop::{LoopHandle, channel}, + calloop::channel, client::{ Proxy, QueueHandle, - protocol::{wl_display::WlDisplay, wl_surface::WlSurface}, + protocol::wl_display::WlDisplay, }, }; 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 } @@ -203,35 +203,35 @@ impl winit::window::Window for SctkWinitWindow { // 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 { // XXX not applicable to wrapped surfaces Default::default() } - fn set_min_surface_size(&self, min_size: Option) { + fn set_min_surface_size(&self, _min_size: Option) { // XXX not applicable to wrapped surfaces } - fn set_max_surface_size(&self, max_size: Option) { + fn set_max_surface_size(&self, _max_size: Option) { // XXX not applicable to wrapped surfaces } fn set_surface_resize_increments( &self, - increments: Option, + _increments: Option, ) { log::warn!( "`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 } - fn set_transparent(&self, transparent: bool) { + fn set_transparent(&self, _transparent: bool) { todo!() } @@ -286,23 +286,23 @@ impl winit::window::Window for SctkWinitWindow { _ = self.tx.send(Action::SetImePurpose(purpose)); } - fn set_blur(&self, blur: bool) { + fn set_blur(&self, _blur: bool) { // TODO } - fn set_visible(&self, visible: bool) {} + fn set_visible(&self, _visible: bool) {} fn is_visible(&self) -> Option { None } - fn set_resizable(&self, resizable: bool) {} + fn set_resizable(&self, _resizable: bool) {} fn is_resizable(&self) -> bool { false } - fn set_enabled_buttons(&self, buttons: winit::window::WindowButtons) { + fn set_enabled_buttons(&self, _buttons: winit::window::WindowButtons) { // TODO v5 of xdg_shell. } @@ -310,7 +310,7 @@ impl winit::window::Window for SctkWinitWindow { WindowButtons::all() } - fn set_minimized(&self, minimized: bool) { + fn set_minimized(&self, _minimized: bool) { // XXX not applicable to the wrapped surfaces } @@ -319,7 +319,7 @@ impl winit::window::Window for SctkWinitWindow { None } - fn set_maximized(&self, maximized: bool) { + fn set_maximized(&self, _maximized: bool) { // XXX can't minimize the wrapped surfaces } @@ -330,7 +330,7 @@ impl winit::window::Window for SctkWinitWindow { fn set_fullscreen( &self, - fullscreen: Option, + _fullscreen: Option, ) { // XXX can't fullscreen the wrapped surfaces } @@ -340,7 +340,7 @@ impl winit::window::Window for SctkWinitWindow { None } - fn set_decorations(&self, decorations: bool) { + fn set_decorations(&self, _decorations: bool) { // XXX no decorations supported for the wrapped surfaces } @@ -348,26 +348,26 @@ impl winit::window::Window for SctkWinitWindow { 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) {} + fn set_window_icon(&self, _window_icon: Option) {} fn focus_window(&self) {} fn request_user_attention( &self, - request_type: Option, + _request_type: Option, ) { // XXX can't request attention on wrapped surfaces } - fn set_theme(&self, theme: Option) {} + fn set_theme(&self, _theme: Option) {} fn theme(&self) -> Option { None } - fn set_content_protected(&self, protected: bool) {} + fn set_content_protected(&self, _protected: bool) {} fn title(&self) -> String { String::new() @@ -420,14 +420,14 @@ impl winit::window::Window for SctkWinitWindow { fn set_cursor_position( &self, - position: winit::dpi::Position, + _position: winit::dpi::Position, ) -> Result<(), winit::error::RequestError> { todo!() } fn set_cursor_grab( &self, - mode: winit::window::CursorGrabMode, + _mode: winit::window::CursorGrabMode, ) -> Result<(), winit::error::RequestError> { todo!() } @@ -438,7 +438,7 @@ impl winit::window::Window for SctkWinitWindow { fn request_ime_update( &self, - request: winit::window::ImeRequest, + _request: winit::window::ImeRequest, ) -> Result<(), winit::window::ImeRequestError> { todo!() } diff --git a/winit/src/proxy.rs b/winit/src/proxy.rs index a3e4e816..e65de2aa 100644 --- a/winit/src/proxy.rs +++ b/winit/src/proxy.rs @@ -8,7 +8,6 @@ use crate::futures::futures::{ use crate::graphics::shell; use crate::runtime::Action; use crate::runtime::window; -use std::hash::DefaultHasher; use std::pin::Pin; /// An event loop proxy with backpressure that implements `Sink`.