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
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:
parent
f388dfdfe4
commit
8a7a32ff92
45 changed files with 85 additions and 139 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use crate::event::{self, Event};
|
||||
use crate::event::Event;
|
||||
use crate::id::Id;
|
||||
use crate::layout;
|
||||
use crate::mouse;
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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};
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)]
|
||||
|
|
|
|||
|
|
@ -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)]
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
use crate::core::Radians;
|
||||
use crate::core::{
|
||||
self, Background, Color, Point, Rectangle, Svg, Transformation, renderer,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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};
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -599,7 +599,7 @@ where
|
|||
(x + width) 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);
|
||||
node.add_action(Action::Focus);
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
///
|
||||
|
|
|
|||
|
|
@ -293,8 +293,8 @@ fn drawing_bounds<Renderer, Handle>(
|
|||
content_fit: ContentFit,
|
||||
rotation: Rotation,
|
||||
scale: f32,
|
||||
opacity: f32,
|
||||
border_radius: [f32; 4],
|
||||
_opacity: f32,
|
||||
_border_radius: [f32; 4],
|
||||
) -> Rectangle
|
||||
where
|
||||
Renderer: image::Renderer<Handle = Handle>,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -527,11 +527,11 @@ where
|
|||
renderer: &Renderer,
|
||||
dnd_rectangles: &mut core::clipboard::DndDestinationRectangles,
|
||||
) {
|
||||
let mut tree = tree
|
||||
let tree = tree
|
||||
.state
|
||||
.downcast_ref::<Rc<RefCell<Option<Tree>>>>()
|
||||
.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],
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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};
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
use crate::container;
|
||||
|
||||
use crate::core::event;
|
||||
use crate::core::layout;
|
||||
use crate::core::mouse;
|
||||
use crate::core::overlay;
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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<
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
//! Access the clipboard.
|
||||
|
||||
use std::sync::Mutex;
|
||||
use std::{any::Any, borrow::Cow};
|
||||
use std::borrow::Cow;
|
||||
|
||||
use crate::Control;
|
||||
|
||||
|
|
|
|||
|
|
@ -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<winit::monitor::MonitorHandle>,
|
||||
_id: Option<String>,
|
||||
) -> 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>,
|
||||
_force: Option<Force>,
|
||||
position: Option<PhysicalPosition<f64>>,
|
||||
scale_factor: f64,
|
||||
) -> touch::Event {
|
||||
|
|
|
|||
|
|
@ -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<dyn winit::window::Window + 'static>) {
|
||||
use crate::a11y::*;
|
||||
use iced_accessibility::accesskit::{
|
||||
ActivationHandler, Node, NodeId, Role,
|
||||
Tree, TreeUpdate,
|
||||
};
|
||||
|
||||
use iced_accessibility::accesskit_winit::Adapter;
|
||||
|
||||
let node_id =
|
||||
|
|
|
|||
|
|
@ -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};
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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<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 {
|
||||
let adjusted_radii = CornerRadius {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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<Self>,
|
||||
_qh: &cctk::sctk::reexports::client::QueueHandle<Self>,
|
||||
seat: cctk::sctk::reexports::client::protocol::wl_seat::WlSeat,
|
||||
) {
|
||||
self.sctk_events.push(SctkEvent::SeatEvent {
|
||||
|
|
|
|||
|
|
@ -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<CosmicCornerRadiusManagerV1, ()> for SctkState {
|
||||
fn event(
|
||||
|
|
@ -31,7 +27,7 @@ impl
|
|||
> for SctkState
|
||||
{
|
||||
fn event(
|
||||
state: &mut Self,
|
||||
_state: &mut Self,
|
||||
_proxy: &CosmicCornerRadiusToplevelV1,
|
||||
event: <CosmicCornerRadiusToplevelV1 as Proxy>::Event,
|
||||
_data: &(),
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
))
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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<u32> {
|
||||
// XXX not applicable to wrapped surfaces
|
||||
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
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
fn set_surface_resize_increments(
|
||||
&self,
|
||||
increments: Option<winit::dpi::Size>,
|
||||
_increments: Option<winit::dpi::Size>,
|
||||
) {
|
||||
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<bool> {
|
||||
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<winit_core::monitor::Fullscreen>,
|
||||
_fullscreen: Option<winit_core::monitor::Fullscreen>,
|
||||
) {
|
||||
// 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<winit_core::icon::Icon>) {}
|
||||
fn set_window_icon(&self, _window_icon: Option<winit_core::icon::Icon>) {}
|
||||
|
||||
fn focus_window(&self) {}
|
||||
|
||||
fn request_user_attention(
|
||||
&self,
|
||||
request_type: Option<winit::window::UserAttentionType>,
|
||||
_request_type: Option<winit::window::UserAttentionType>,
|
||||
) {
|
||||
// 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> {
|
||||
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!()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue