chore: format for Rust 2024

This commit is contained in:
Vukašin Vojinović 2025-10-16 18:53:57 +02:00 • committed by Victoria Brekenfeld
parent 0a8da05847
commit 1f7f0c70b7
99 changed files with 414 additions and 442 deletions

View file

@ -3,7 +3,7 @@ use tracing::warn;
use crate::{
config::ColorFilter,
state::State,
wayland::protocols::a11y::{delegate_a11y, A11yHandler, A11yState},
wayland::protocols::a11y::{A11yHandler, A11yState, delegate_a11y},
};
impl A11yHandler for State {

View file

@ -22,7 +22,7 @@ use xkbcommon::xkb;
use crate::{
state::State,
wayland::protocols::atspi::{delegate_atspi, AtspiHandler},
wayland::protocols::atspi::{AtspiHandler, delegate_atspi},
};
#[derive(PartialEq, Debug)]

View file

@ -2,7 +2,7 @@
use crate::state::{BackendData, State};
use smithay::{
reexports::wayland_server::{protocol::wl_buffer::WlBuffer, Resource},
reexports::wayland_server::{Resource, protocol::wl_buffer::WlBuffer},
wayland::buffer::BufferHandler,
};
use tracing::warn;

View file

@ -4,18 +4,18 @@ use crate::{shell::grabs::SeatMoveGrabState, state::ClientState, utils::prelude:
use calloop::Interest;
use smithay::{
backend::renderer::{
element::{surface::KindEvaluation, Kind},
element::{Kind, surface::KindEvaluation},
utils::{on_commit_buffer_handler, with_renderer_surface_state},
},
delegate_compositor,
desktop::{layer_map_for_output, LayerSurface, PopupKind, WindowSurfaceType},
reexports::wayland_server::{protocol::wl_surface::WlSurface, Client, Resource},
utils::{Clock, Logical, Monotonic, Size, Time, SERIAL_COUNTER},
desktop::{LayerSurface, PopupKind, WindowSurfaceType, layer_map_for_output},
reexports::wayland_server::{Client, Resource, protocol::wl_surface::WlSurface},
utils::{Clock, Logical, Monotonic, SERIAL_COUNTER, Size, Time},
wayland::{
compositor::{
add_blocker, add_post_commit_hook, add_pre_commit_hook, with_states,
with_surface_tree_downward, BufferAssignment, CompositorClientState, CompositorHandler,
CompositorState, SurfaceAttributes, SurfaceData, TraversalAction,
BufferAssignment, CompositorClientState, CompositorHandler, CompositorState,
SurfaceAttributes, SurfaceData, TraversalAction, add_blocker, add_post_commit_hook,
add_pre_commit_hook, with_states, with_surface_tree_downward,
},
dmabuf::get_dmabuf,
drm_syncobj::DrmSyncobjCachedState,

View file

@ -1,7 +1,7 @@
use cosmic_protocols::corner_radius::v1::server::cosmic_corner_radius_toplevel_v1;
use crate::wayland::protocols::corner_radius::{
delegate_corner_radius, CornerRadiusData, CornerRadiusHandler, CornerRadiusState,
CornerRadiusData, CornerRadiusHandler, CornerRadiusState, delegate_corner_radius,
};
use crate::state::State;

View file

@ -4,8 +4,8 @@ use crate::{state::State, utils::prelude::SeatExt};
use smithay::{
delegate_data_device,
input::{
pointer::{CursorImageStatus, CursorImageSurfaceData},
Seat,
pointer::{CursorImageStatus, CursorImageSurfaceData},
},
reexports::wayland_server::protocol::{wl_data_source::WlDataSource, wl_surface::WlSurface},
utils::{IsAlive, Logical, Point},

View file

@ -15,7 +15,7 @@ use smithay::{
seat::WaylandFocus,
shell::{
kde::decoration::{KdeDecorationHandler, KdeDecorationState},
xdg::{decoration::XdgDecorationHandler, ToplevelSurface},
xdg::{ToplevelSurface, decoration::XdgDecorationHandler},
},
},
};

View file

@ -2,11 +2,11 @@
use crate::{
state::{BackendData, State},
wayland::protocols::drm::{delegate_wl_drm, DrmHandler, ImportError},
wayland::protocols::drm::{DrmHandler, ImportError, delegate_wl_drm},
};
use smithay::{
backend::{allocator::dmabuf::Dmabuf, drm::DrmNode},
reexports::wayland_server::{protocol::wl_buffer::WlBuffer, Resource},
reexports::wayland_server::{Resource, protocol::wl_buffer::WlBuffer},
wayland::dmabuf::DmabufGlobal,
};
use tracing::warn;

View file

@ -5,7 +5,7 @@ use smithay::{
reexports::wayland_server::protocol::wl_surface::WlSurface,
wayland::{
compositor::{get_parent, with_states},
fractional_scale::{with_fractional_scale, FractionalScaleHandler},
fractional_scale::{FractionalScaleHandler, with_fractional_scale},
},
};

View file

@ -3,7 +3,7 @@
use crate::state::State;
use smithay::{
delegate_input_method_manager,
desktop::{space::SpaceElement, PopupKind, PopupManager},
desktop::{PopupKind, PopupManager, space::SpaceElement},
reexports::wayland_server::protocol::wl_surface::WlSurface,
utils::Rectangle,
wayland::input_method::{InputMethodHandler, PopupSurface},

View file

@ -3,7 +3,7 @@
use crate::{shell::PendingLayer, utils::prelude::*};
use smithay::{
delegate_layer_shell,
desktop::{layer_map_for_output, LayerSurface, PopupKind, WindowSurfaceType},
desktop::{LayerSurface, PopupKind, WindowSurfaceType, layer_map_for_output},
output::Output,
reexports::wayland_server::protocol::wl_output::WlOutput,
wayland::shell::{

View file

@ -8,8 +8,8 @@ use crate::{
state::State,
utils::prelude::OutputExt,
wayland::protocols::output_configuration::{
delegate_output_configuration, ModeConfiguration, OutputConfiguration,
OutputConfigurationHandler, OutputConfigurationState,
ModeConfiguration, OutputConfiguration, OutputConfigurationHandler,
OutputConfigurationState, delegate_output_configuration,
},
};

View file

@ -7,7 +7,7 @@ use crate::{
state::{BackendData, State},
utils::prelude::OutputExt,
wayland::protocols::output_power::{
delegate_output_power, OutputPowerHandler, OutputPowerState,
OutputPowerHandler, OutputPowerState, delegate_output_power,
},
};

View file

@ -1,5 +1,5 @@
use smithay::{
desktop::{layer_map_for_output, LayerSurface, WindowSurfaceType},
desktop::{LayerSurface, WindowSurfaceType, layer_map_for_output},
output::Output,
reexports::wayland_protocols_wlr::layer_shell::v1::server::zwlr_layer_surface_v1::ZwlrLayerSurfaceV1,
};
@ -7,7 +7,7 @@ use smithay::{
use crate::{
state::State,
wayland::protocols::overlap_notify::{
delegate_overlap_notify, OverlapNotifyHandler, OverlapNotifyState,
OverlapNotifyHandler, OverlapNotifyState, delegate_overlap_notify,
},
};

View file

@ -7,7 +7,7 @@ use smithay::{
reexports::wayland_server::protocol::wl_surface::WlSurface,
utils::{Logical, Point},
wayland::{
pointer_constraints::{with_pointer_constraint, PointerConstraintsHandler},
pointer_constraints::{PointerConstraintsHandler, with_pointer_constraint},
seat::WaylandFocus,
},
};

View file

@ -27,9 +27,8 @@ use crate::{
wayland::protocols::{
image_capture_source::ImageCaptureSourceData,
screencopy::{
delegate_screencopy, BufferConstraints, CursorSession, CursorSessionRef,
DmabufConstraints, Frame, FrameRef, ScreencopyHandler, ScreencopyState, Session,
SessionRef,
BufferConstraints, CursorSession, CursorSessionRef, DmabufConstraints, Frame, FrameRef,
ScreencopyHandler, ScreencopyState, Session, SessionRef, delegate_screencopy,
},
},
};

View file

@ -1,19 +1,19 @@
use calloop::LoopHandle;
use smithay::{
backend::{
allocator::{dmabuf::Dmabuf, format::get_transparent, Buffer, Fourcc},
allocator::{Buffer, Fourcc, dmabuf::Dmabuf, format::get_transparent},
renderer::{
Bind, Blit, BufferType, Color32F, ExportMem, ImportAll, ImportMem, Offscreen, Renderer,
buffer_dimensions, buffer_type,
damage::{Error as DTError, OutputDamageTracker, RenderOutputResult},
element::{
AsRenderElements, RenderElement,
surface::WaylandSurfaceRenderElement,
utils::{Relocate, RelocateRenderElement},
AsRenderElements, RenderElement,
},
gles::{GlesError, GlesRenderbuffer},
sync::SyncPoint,
utils::with_renderer_surface_state,
Bind, Blit, BufferType, Color32F, ExportMem, ImportAll, ImportMem, Offscreen, Renderer,
},
},
desktop::space::SpaceElement,
@ -35,16 +35,16 @@ use tracing::warn;
use crate::{
backend::render::{
cursor,
CursorMode, ElementFilter, RendererRef, cursor,
element::{AsGlowRenderer, CosmicElement, DamageElement, FromGlesError},
render_workspace, CursorMode, ElementFilter, RendererRef,
render_workspace,
},
shell::{CosmicMappedRenderElement, CosmicSurface, WorkspaceRenderElement},
state::{Common, KmsNodes, State},
utils::prelude::{PointExt, PointGlobalExt, RectExt, RectLocalExt, SeatExt},
wayland::{
handlers::screencopy::{
constraints_for_output, constraints_for_toplevel, SessionData, SessionUserData,
SessionData, SessionUserData, constraints_for_output, constraints_for_toplevel,
},
protocols::{
screencopy::{BufferConstraints, CursorSessionRef, FailureReason, Frame, SessionRef},

View file

@ -3,7 +3,7 @@ use std::{cell::RefCell, collections::HashMap, sync::Mutex};
use smithay::{
backend::renderer::{damage::OutputDamageTracker, utils::CommitCounter},
output::Output,
reexports::wayland_server::{protocol::wl_buffer::WlBuffer, Resource, Weak},
reexports::wayland_server::{Resource, Weak, protocol::wl_buffer::WlBuffer},
};
use crate::{

View file

@ -1,14 +1,14 @@
// SPDX-License-Identifier: GPL-3.0-only
use crate::{
shell::focus::target::{KeyboardFocusTarget, PointerFocusTarget},
shell::Devices,
shell::focus::target::{KeyboardFocusTarget, PointerFocusTarget},
state::State,
utils::prelude::SeatExt,
};
use smithay::{
delegate_cursor_shape, delegate_seat,
input::{keyboard::LedState, pointer::CursorImageStatus, SeatHandler, SeatState},
input::{SeatHandler, SeatState, keyboard::LedState, pointer::CursorImageStatus},
};
impl SeatHandler for State {

View file

@ -4,7 +4,7 @@ use crate::{shell::SessionLock, state::State, utils::prelude::*};
use smithay::{
delegate_session_lock,
output::Output,
reexports::wayland_server::{protocol::wl_output::WlOutput, Resource},
reexports::wayland_server::{Resource, protocol::wl_output::WlOutput},
utils::Size,
wayland::session_lock::{
LockSurface, SessionLockHandler, SessionLockManagerState, SessionLocker,

View file

@ -1,13 +1,13 @@
// SPDX-License-Identifier: GPL-3.0-only
use smithay::utils::{user_data::UserDataMap, Rectangle};
use smithay::utils::{Rectangle, user_data::UserDataMap};
use crate::{
shell::CosmicSurface,
state::State,
utils::prelude::Global,
wayland::protocols::toplevel_info::{
delegate_toplevel_info, ToplevelInfoHandler, ToplevelInfoState, Window,
ToplevelInfoHandler, ToplevelInfoState, Window, delegate_toplevel_info,
},
};

View file

@ -1,22 +1,22 @@
// SPDX-License-Identifier: GPL-3.0-only
use smithay::{
desktop::{layer_map_for_output, WindowSurfaceType},
input::{pointer::MotionEvent, Seat},
desktop::{WindowSurfaceType, layer_map_for_output},
input::{Seat, pointer::MotionEvent},
output::Output,
reexports::wayland_server::DisplayHandle,
utils::{Point, Rectangle, Size, SERIAL_COUNTER},
utils::{Point, Rectangle, SERIAL_COUNTER, Size},
wayland::seat::WaylandFocus,
};
use crate::{
shell::{focus::target::KeyboardFocusTarget, CosmicSurface, Shell, WorkspaceDelta},
shell::{CosmicSurface, Shell, WorkspaceDelta, focus::target::KeyboardFocusTarget},
utils::prelude::*,
wayland::protocols::{
toplevel_info::ToplevelInfoHandler,
toplevel_management::{
delegate_toplevel_management, toplevel_rectangle_for, ManagementWindow,
ToplevelManagementHandler, ToplevelManagementState,
ManagementWindow, ToplevelManagementHandler, ToplevelManagementState,
delegate_toplevel_management, toplevel_rectangle_for,
},
workspace::WorkspaceHandle,
},

View file

@ -4,7 +4,7 @@ use crate::{
shell::WorkspaceDelta,
utils::prelude::*,
wayland::protocols::workspace::{
delegate_workspace, Request, State as WState, WorkspaceHandler, WorkspaceState,
Request, State as WState, WorkspaceHandler, WorkspaceState, delegate_workspace,
},
};
use cosmic_protocols::workspace::v2::server::zcosmic_workspace_handle_v2::TilingState;

View file

@ -1,5 +1,5 @@
use crate::shell::focus::target::KeyboardFocusTarget;
use crate::shell::WorkspaceDelta;
use crate::shell::focus::target::KeyboardFocusTarget;
use crate::{shell::ActivationKey, state::ClientState, utils::prelude::*};
use crate::{
state::State,

View file

@ -1,17 +1,17 @@
// SPDX-License-Identifier: GPL-3.0-only
use crate::{
shell::{focus::target::KeyboardFocusTarget, grabs::ReleaseMode, CosmicSurface, PendingWindow},
shell::{CosmicSurface, PendingWindow, focus::target::KeyboardFocusTarget, grabs::ReleaseMode},
utils::prelude::*,
};
use smithay::desktop::layer_map_for_output;
use smithay::{
delegate_xdg_shell,
desktop::{
find_popup_root_surface, PopupGrab, PopupKeyboardGrab, PopupKind, PopupPointerGrab,
PopupUngrabStrategy, WindowSurfaceType,
PopupGrab, PopupKeyboardGrab, PopupKind, PopupPointerGrab, PopupUngrabStrategy,
WindowSurfaceType, find_popup_root_surface,
},
input::{pointer::Focus, Seat},
input::{Seat, pointer::Focus},
output::Output,
reexports::{
wayland_protocols::xdg::shell::server::xdg_toplevel,

View file

@ -3,8 +3,8 @@
use crate::{shell::Shell, utils::prelude::*};
use smithay::{
desktop::{
get_popup_toplevel_coords, layer_map_for_output, space::SpaceElement, LayerSurface,
PopupKind, PopupManager, WindowSurfaceType,
LayerSurface, PopupKind, PopupManager, WindowSurfaceType, get_popup_toplevel_coords,
layer_map_for_output, space::SpaceElement,
},
output::Output,
reexports::{
@ -15,7 +15,7 @@ use smithay::{
wayland::{
compositor::{get_role, with_states},
seat::WaylandFocus,
shell::xdg::{PopupSurface, ToplevelSurface, XdgPopupSurfaceData, XDG_POPUP_ROLE},
shell::xdg::{PopupSurface, ToplevelSurface, XDG_POPUP_ROLE, XdgPopupSurfaceData},
},
};
use tracing::warn;

View file

@ -4,7 +4,7 @@ use crate::{shell::focus::target::KeyboardFocusTarget, state::State};
use smithay::{
delegate_xwayland_keyboard_grab,
input::Seat,
reexports::wayland_server::{protocol::wl_surface::WlSurface, Resource},
reexports::wayland_server::{Resource, protocol::wl_surface::WlSurface},
wayland::xwayland_keyboard_grab::{XWaylandKeyboardGrab, XWaylandKeyboardGrabHandler},
};
use std::sync::Mutex;