From 1b4db0e68170e44ff3a4f649a15dd18a1cab7432 Mon Sep 17 00:00:00 2001 From: Samuel Onoja Date: Thu, 22 Oct 2026 00:52:00 +0100 Subject: [PATCH] Make module dependencies explicit across the workspace --- compositor/src/activities.rs | 6 ++-- compositor/src/activities/deadline.rs | 11 +++--- compositor/src/activities/pomodoro.rs | 5 ++- compositor/src/activities/publication.rs | 9 +++-- compositor/src/activities_process.rs | 6 ++-- compositor/src/backends/direct.rs | 2 +- compositor/src/backends/direct/lid.rs | 5 ++- compositor/src/backends/direct/mirror.rs | 10 +++++- compositor/src/backends/direct/recovery.rs | 4 ++- compositor/src/backends/direct/scheduling.rs | 5 ++- .../src/backends/direct/session_device.rs | 13 +++++-- compositor/src/backends/direct/topology.rs | 8 ++++- compositor/src/backends/direct/transaction.rs | 13 +++++-- compositor/src/config.rs | 15 ++++---- compositor/src/config/appearance.rs | 5 ++- compositor/src/config/bindings.rs | 5 ++- compositor/src/config/bindings/index.rs | 15 +++++++- compositor/src/config/bindings/modes.rs | 8 ++++- compositor/src/config/input_motion.rs | 5 ++- compositor/src/config/layout.rs | 5 ++- compositor/src/config/outputs.rs | 2 +- compositor/src/config/tab_indicator.rs | 2 +- compositor/src/handlers/activation.rs | 3 +- compositor/src/handlers/dispatch.rs | 4 +-- compositor/src/handlers/gamma_control.rs | 4 ++- compositor/src/handlers/screenshot.rs | 14 ++++---- compositor/src/idle_inhibition/media.rs | 3 +- compositor/src/idle_inhibition/media/bus.rs | 6 ++-- compositor/src/input/binding_mode_tests.rs | 3 +- compositor/src/input/layer_focus_tests.rs | 7 ++-- compositor/src/ipc_events.rs | 3 +- compositor/src/process/supervisor.rs | 5 ++- compositor/src/render/backdrop.rs | 11 +++++- compositor/src/render/capture.rs | 8 ++++- compositor/src/render/closing.rs | 6 +++- compositor/src/render/corner_tests.rs | 2 +- compositor/src/render/decorations.rs | 15 +++++--- compositor/src/render/materials.rs | 13 ++++++- compositor/src/render/mod.rs | 36 ++++++++++++------- compositor/src/render/overview.rs | 10 +++++- compositor/src/render/resources.rs | 24 ++++++++++++- compositor/src/render/scene.rs | 20 ++++++++++- compositor/src/render/tab_indicator.rs | 7 +++- compositor/src/render/tabs.rs | 7 +++- compositor/src/render/window_blur.rs | 6 +++- compositor/src/render/window_content.rs | 33 ++++++++++++++++- compositor/src/startup_tests.rs | 5 ++- compositor/src/state.rs | 3 -- compositor/src/state/animation.rs | 22 +++++++++++- compositor/src/state/capture_privacy_tests.rs | 6 ++-- compositor/src/state/floating.rs | 7 +++- compositor/src/state/focus.rs | 3 +- compositor/src/state/hit_testing.rs | 6 +++- compositor/src/state/layout.rs | 8 ++++- compositor/src/state/lifecycle.rs | 2 +- compositor/src/state/navigation.rs | 6 +++- compositor/src/state/outputs.rs | 14 +++++++- compositor/src/state/panel_clearance_tests.rs | 2 ++ compositor/src/state/prediction.rs | 18 +++++++++- .../src/state/presentation_dependencies.rs | 19 +++++++++- compositor/src/state/reconciliation.rs | 29 ++++++++++++++- compositor/src/state/tab_indicator.rs | 11 +++--- compositor/src/state/tabs.rs | 4 ++- compositor/src/state/viewport.rs | 15 +++++++- .../src/state/window_lifecycle_tests.rs | 6 ++-- compositor/src/state/windows.rs | 7 +++- compositor/src/theme.rs | 6 ++-- compositor/src/xwayland/integration_tests.rs | 3 +- crates/ferese-animation/src/gesture.rs | 3 +- crates/ferese-ipc/src/theme.rs | 3 +- crates/ferese-theme/src/palette.rs | 3 +- crates/ferese-theme/src/panel.rs | 3 +- crates/ferese-theme/src/panel_surface.rs | 5 +-- crates/ferese-theme/src/workspaces.rs | 6 ++-- feresectl/src/activities/setup.rs | 6 ++-- feresectl/src/activities/transport.rs | 3 +- feresectl/src/pomodoro.rs | 5 ++- shell/ferese-settings/src/main.rs | 15 ++++---- shell/ferese-settings/src/panel_controls.rs | 6 ++-- shell/ferese-settings/src/panel_drag.rs | 3 +- shell/ferese-settings/src/panel_preview.rs | 5 ++- .../ferese-settings/src/wallpaper_controls.rs | 6 ++-- shell/ferese-shell/src/bar.rs | 3 +- shell/ferese-shell/src/clock.rs | 3 +- shell/ferese-shell/src/display_mode.rs | 7 ++-- shell/ferese-shell/src/launcher/mod.rs | 11 ++++-- shell/ferese-shell/src/launcher/thumbnails.rs | 2 +- shell/ferese-shell/src/launcher/view.rs | 6 +++- shell/ferese-shell/src/launcher/work.rs | 6 ++-- shell/ferese-shell/src/main.rs | 7 ++-- shell/ferese-shell/src/motion.rs | 3 +- shell/ferese-shell/src/motion/frames.rs | 13 +++++-- shell/ferese-shell/src/notification_ui.rs | 11 ++++-- shell/ferese-shell/src/panel_hub.rs | 14 ++++---- shell/ferese-shell/src/panel_hub/battery.rs | 2 +- shell/ferese-shell/src/panel_hub/equalizer.rs | 3 +- .../src/panel_hub/workspace_grid.rs | 6 ++-- .../src/panel_hub/workspace_grid/drag.rs | 3 +- .../ferese-shell/src/panel_hub/workspaces.rs | 6 ++-- shell/ferese-shell/src/panel_runtime.rs | 3 +- shell/ferese-shell/src/status_ui/lifecycle.rs | 3 +- shell/ferese-shell/src/status_ui/mod.rs | 12 ++++--- .../ferese-shell/src/status_ui/night_light.rs | 2 +- shell/ferese-shell/src/system_modal.rs | 8 ++++- 104 files changed, 614 insertions(+), 203 deletions(-) diff --git a/compositor/src/activities.rs b/compositor/src/activities.rs index 37b7f3f..90fa60a 100644 --- a/compositor/src/activities.rs +++ b/compositor/src/activities.rs @@ -4,10 +4,8 @@ pub(crate) mod deadline; mod pomodoro; mod publication; use ferese_activities::{Data, Id, Owner, Source, State, Store, Template, Value}; -use ferese_ipc::{ - Response, - activities::{Publish, Snapshot}, -}; +use ferese_ipc::Response; +use ferese_ipc::activities::{Publish, Snapshot}; use serde_json::json; use std::collections::BTreeMap; use std::sync::mpsc::SyncSender; diff --git a/compositor/src/activities/deadline.rs b/compositor/src/activities/deadline.rs index 6221c33..734925d 100644 --- a/compositor/src/activities/deadline.rs +++ b/compositor/src/activities/deadline.rs @@ -1,12 +1,9 @@ //! Activity deadlines share CLOCK_BOOTTIME with the published countdowns. A //! monotonic calloop timer would otherwise keep waiting for time spent asleep. -use smithay::reexports::calloop::{ - Interest, LoopHandle, Mode, PostAction, RegistrationToken, generic::Generic, -}; -use std::{ - io, - os::fd::{AsRawFd, FromRawFd, OwnedFd}, -}; +use smithay::reexports::calloop::generic::Generic; +use smithay::reexports::calloop::{Interest, LoopHandle, Mode, PostAction, RegistrationToken}; +use std::io; +use std::os::fd::{AsRawFd, FromRawFd, OwnedFd}; pub(crate) struct Deadline { fd: OwnedFd, diff --git a/compositor/src/activities/pomodoro.rs b/compositor/src/activities/pomodoro.rs index c7b48aa..3ffbabc 100644 --- a/compositor/src/activities/pomodoro.rs +++ b/compositor/src/activities/pomodoro.rs @@ -1,4 +1,7 @@ -use super::*; +use super::{Data, Duration, Engine, Id, Source, State, Template, Value}; +#[cfg(test)] +use ferese_activities::Owner; + use ferese_activities::pomodoro::{Session, Status}; use ferese_ipc::activities::{PomodoroAction, PomodoroRequest}; diff --git a/compositor/src/activities/publication.rs b/compositor/src/activities/publication.rs index 8cab6fe..b8ef0ab 100644 --- a/compositor/src/activities/publication.rs +++ b/compositor/src/activities/publication.rs @@ -1,9 +1,8 @@ //! Bounded serialization and delivery outside the compositor event loop. -use ferese_ipc::{Response, activities::Snapshot}; -use std::sync::{ - Arc, RwLock, - mpsc::{self, SyncSender}, -}; +use ferese_ipc::Response; +use ferese_ipc::activities::Snapshot; +use std::sync::mpsc::{self, SyncSender}; +use std::sync::{Arc, RwLock}; type Recipient = (u64, SyncSender); struct Job { diff --git a/compositor/src/activities_process.rs b/compositor/src/activities_process.rs index d865a44..0ae0c4d 100644 --- a/compositor/src/activities_process.rs +++ b/compositor/src/activities_process.rs @@ -5,10 +5,8 @@ use ferese_activities::Owner; use smithay::reexports::calloop::channel; use std::collections::BTreeMap; use std::io::Read; -use std::sync::{ - Arc, - atomic::{AtomicBool, Ordering}, -}; +use std::sync::Arc; +use std::sync::atomic::{AtomicBool, Ordering}; use std::time::Duration; pub(crate) struct Watcher(Arc); diff --git a/compositor/src/backends/direct.rs b/compositor/src/backends/direct.rs index e9f99d8..96b4eda 100644 --- a/compositor/src/backends/direct.rs +++ b/compositor/src/backends/direct.rs @@ -23,7 +23,7 @@ mod transaction; use diagnostics::{Diagnostics, PrimaryOutcome}; use output_power::{OutputPower, Power}; use redraw::{AnimationFallback, SchedulingMetrics}; -use scheduling::*; +use scheduling::{cancel_output_timers, monotonic_now, request_frame, arm_frame, record_frame_schedule}; use smithay::backend::allocator::gbm::{GbmAllocator, GbmBufferFlags, GbmDevice}; use smithay::backend::allocator::{Buffer, Fourcc}; use smithay::backend::drm::compositor::{DrmCompositor, FrameFlags, PrimaryPlaneElement}; diff --git a/compositor/src/backends/direct/lid.rs b/compositor/src/backends/direct/lid.rs index a8a4168..da96e71 100644 --- a/compositor/src/backends/direct/lid.rs +++ b/compositor/src/backends/direct/lid.rs @@ -1,7 +1,10 @@ //! Resume reads are asynchronous; newer switch events win over old replies. use std::sync::{Arc, Mutex, mpsc}; -use super::*; +use super::{ + Duration, Error, Ferese, RegistrationToken, TimeoutAction, Timer, cancel_output_timers, + reconcile_outputs, +}; #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub(super) struct Probe { diff --git a/compositor/src/backends/direct/mirror.rs b/compositor/src/backends/direct/mirror.rs index 60c5e7d..d006b17 100644 --- a/compositor/src/backends/direct/mirror.rs +++ b/compositor/src/backends/direct/mirror.rs @@ -1,6 +1,14 @@ //! A target displays a composition of the source, with no second workspace or input domain. //! Source alone releases client callbacks/presentation feedback. Targets have independent KMS clocks. -use super::*; +#[cfg(test)] +use smithay::backend::allocator::Fourcc; +#[cfg(test)] +use smithay::output::Scale; + +use super::{ + CommitCounter, DirectOutput, Ferese, GlesRenderer, GlesTexture, Output, OutputMode, + PhysicalProperties, Subpixel, Transform, capture, sampled_output_elements, +}; use smithay::backend::renderer::Texture; use smithay::utils::{Buffer, Physical, Rectangle}; diff --git a/compositor/src/backends/direct/recovery.rs b/compositor/src/backends/direct/recovery.rs index b874669..99e0933 100644 --- a/compositor/src/backends/direct/recovery.rs +++ b/compositor/src/backends/direct/recovery.rs @@ -1,5 +1,7 @@ //! Uncertain KMS completion requires device reconciliation, not buffer reuse. -use super::*; +use super::{ + DirectOutput, DrmNode, Duration, Ferese, Instant, TimeoutAction, Timer, crtc, reconcile_outputs, +}; const COMPLETION_TIMEOUT: Duration = Duration::from_secs(2); diff --git a/compositor/src/backends/direct/scheduling.rs b/compositor/src/backends/direct/scheduling.rs index 9cd4e22..7663bd5 100644 --- a/compositor/src/backends/direct/scheduling.rs +++ b/compositor/src/backends/direct/scheduling.rs @@ -1,4 +1,7 @@ -use super::*; +use super::{ + DirectOutput, DrmNode, Duration, Ferese, Instant, Monotonic, Output, OutputMode, TimeoutAction, + Timer, arm_animation_timer, crtc, render_output, sleep_locked_outputs, +}; use crate::frame_scheduler::FramePlan; pub(super) fn monotonic_now() -> Duration { diff --git a/compositor/src/backends/direct/session_device.rs b/compositor/src/backends/direct/session_device.rs index 532a849..99c6162 100644 --- a/compositor/src/backends/direct/session_device.rs +++ b/compositor/src/backends/direct/session_device.rs @@ -1,5 +1,9 @@ -use smithay::{backend::session::Session, reexports::rustix::fs::OFlags, utils::DeviceFd}; -use std::{io, os::fd::OwnedFd, path::Path}; +use smithay::backend::session::Session; +use smithay::reexports::rustix::fs::OFlags; +use smithay::utils::DeviceFd; +use std::io; +use std::os::fd::OwnedFd; +use std::path::Path; pub(super) struct SessionDevice { session: S, @@ -37,7 +41,10 @@ impl Drop for SessionDevice { #[cfg(test)] mod tests { use super::*; - use std::{cell::Cell, fs::File, os::fd::AsRawFd, rc::Rc}; + use std::cell::Cell; + use std::fs::File; + use std::os::fd::AsRawFd; + use std::rc::Rc; #[derive(Clone, Default)] struct TestSession(Rc>>); diff --git a/compositor/src/backends/direct/topology.rs b/compositor/src/backends/direct/topology.rs index 0df8850..e9508a0 100644 --- a/compositor/src/backends/direct/topology.rs +++ b/compositor/src/backends/direct/topology.rs @@ -1,7 +1,13 @@ //! Desired device identities survive temporary loss of their DRM resources. use std::path::PathBuf; -use super::*; +use super::{ + DrmNode, Duration, Ferese, HashMap, HashSet, Instant, OutputMode, Path, PresentationClock, + RegistrationToken, Scale, Session, TimeoutAction, Timer, all_gpus, cancel_output_timers, + drm_device_key, lid, monotonic_now, open_device, output_transform, refresh_connected_info, + refresh_monitor_policy, remember_applied_configuration, remove_device, rescan_device, + sync_battery_timer, transaction, validate_desired_outputs, +}; #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub(super) enum Availability { diff --git a/compositor/src/backends/direct/transaction.rs b/compositor/src/backends/direct/transaction.rs index bb62748..e19ab08 100644 --- a/compositor/src/backends/direct/transaction.rs +++ b/compositor/src/backends/direct/transaction.rs @@ -1,10 +1,19 @@ //! Validate a device-wide desired topology, then use Smithay for every real commit. //! Smithay exposes TEST_ONLY per surface, but not a combined CRTC request. The //! one raw request here is validation only; mode/plane ownership stays in Smithay. -use super::*; +use super::{ + ControlDevice, DesiredOutputConfiguration, DirectDevice, DirectOutput, DrmDevice, DrmDeviceFd, + DrmMode, DrmNode, Error, Ferese, Fourcc, GbmAllocator, GbmBufferFlags, GbmFramebufferExporter, + GlesRenderer, HashMap, HashSet, OutputCompositor, OutputMode, OutputModeSource, OutputScan, + OutputSelection, OutputSettings, PrimaryPlaneElement, cancel_output_timers, + connected_mode_info, connector, create_direct_output, create_output, crtc, drm_device_key, + internal_connector, io, output_transform, property, remember_applied_configuration, + rescan_device, validate_desired_outputs, +}; use smithay::backend::allocator::Allocator; use smithay::backend::drm::exporter::{ExportBuffer, ExportFramebuffer}; -use smithay::reexports::drm::control::{AtomicCommitFlags, ResourceHandle, atomic::AtomicModeReq}; +use smithay::reexports::drm::control::atomic::AtomicModeReq; +use smithay::reexports::drm::control::{AtomicCommitFlags, ResourceHandle}; fn property( drm: &D, diff --git a/compositor/src/config.rs b/compositor/src/config.rs index e70bd0d..e16a6aa 100644 --- a/compositor/src/config.rs +++ b/compositor/src/config.rs @@ -14,18 +14,17 @@ use std::path::PathBuf; pub(crate) use self::loading::{prepare, prepare_document, read_source, startup}; pub(crate) use self::xwayland::{XwaylandConfig, XwaylandStartup}; -use appearance::*; +use appearance::{AppearanceConfig, ThemeConfig, parse_color}; pub use appearance::{BorderGradient, FocusEffectSettings, MaterialStyle, ThemeSettings}; -pub(crate) use bindings::BindingModes; -use bindings::*; pub use bindings::{Binding, BindingAction}; -pub(crate) use bindings::{BindingSet, physical_keymap}; +use bindings::{BindingConfig, BindingMatch, BindingModeConfig, BindingModifiers}; +pub(crate) use bindings::{BindingModes, BindingSet, physical_keymap}; use ferese_animation::SpringConfig; use ferese_core::LayoutMode; use ferese_layout::{ColumnWidth, Direction, GapConfig, ViewportFocusStrategy}; pub use input_motion::InputSettings; -use input_motion::*; -use outputs::*; +use input_motion::{AnimationsConfig, InputConfig}; +use outputs::OutputProfileConfig; pub use outputs::{ LidPolicy, OutputLayout, OutputModeRequest, OutputProfile, OutputSettings, OutputTransform, }; @@ -567,6 +566,10 @@ mod tests { } use super::*; + use crate::config::appearance::RgbaColor; + use crate::config::bindings::BindingTrigger; + use crate::config::bindings::parse_action; + use crate::config::input_motion::TouchpadSettings; #[test] fn display_key_has_a_default_binding_and_can_be_rebound() { diff --git a/compositor/src/config/appearance.rs b/compositor/src/config/appearance.rs index 8e33ddc..d072aaf 100644 --- a/compositor/src/config/appearance.rs +++ b/compositor/src/config/appearance.rs @@ -1,4 +1,7 @@ -use super::*; +use super::{ + Config, ConfigError, Deserialize, default_border_width, default_focus_ring_width, + default_shadow_blur, default_shadow_offset_y, default_shadow_opacity, default_window_radius, +}; impl Config { pub(crate) fn focus_effect_settings(&self) -> Result { diff --git a/compositor/src/config/bindings.rs b/compositor/src/config/bindings.rs index 4d02de2..0a5fb13 100644 --- a/compositor/src/config/bindings.rs +++ b/compositor/src/config/bindings.rs @@ -1,6 +1,9 @@ use std::sync::Arc; -use super::*; +use super::{ + BindingIdentity, Config, ConfigError, Deserialize, Direction, HashMap, HashSet, InputSettings, + Keycode, keysyms, xkb, +}; mod index; mod modes; diff --git a/compositor/src/config/bindings/index.rs b/compositor/src/config/bindings/index.rs index 621b8d0..807636f 100644 --- a/compositor/src/config/bindings/index.rs +++ b/compositor/src/config/bindings/index.rs @@ -1,4 +1,14 @@ -use super::*; +#[cfg(test)] +use crate::config::BindingAction; +#[cfg(test)] +use ferese_layout::Direction; +#[cfg(test)] +use smithay::input::keyboard::keysyms; + +use super::{ + Binding, BindingIdentity, BindingMatch, BindingModifiers, HashMap, Keycode, + binding_identity_for_runtime, +}; /// Immutable bindings and their keyboard index are replaced together on reload. /// The ordered slice remains available for gestures and the shortcut guide. @@ -87,6 +97,9 @@ impl BindingSet { #[cfg(test)] mod tests { use super::*; + use crate::config::Config; + use crate::config::bindings::BindingTrigger; + use std::sync::Arc; fn binding_for(trigger: BindingTrigger, action: BindingAction) -> Binding { Binding { diff --git a/compositor/src/config/bindings/modes.rs b/compositor/src/config/bindings/modes.rs index bb4402d..a5fa3f6 100644 --- a/compositor/src/config/bindings/modes.rs +++ b/compositor/src/config/bindings/modes.rs @@ -1,4 +1,10 @@ -use super::*; +use super::{ + Binding, BindingAction, BindingConfig, BindingMatch, BindingSet, Config, ConfigError, + Deserialize, HashMap, HashSet, InputSettings, Keycode, binding_identity, keysyms, + parse_binding, physical_keymap, +}; +#[cfg(test)] +use ferese_layout::Direction; #[derive(Debug, Deserialize)] #[serde(deny_unknown_fields)] diff --git a/compositor/src/config/input_motion.rs b/compositor/src/config/input_motion.rs index 6b550c8..ebcc51d 100644 --- a/compositor/src/config/input_motion.rs +++ b/compositor/src/config/input_motion.rs @@ -1,4 +1,7 @@ -use super::*; +use super::{ + Config, ConfigError, Deserialize, SpringConfig, default_repeat_delay, default_repeat_rate, + enabled_by_default, +}; impl Config { pub fn input_settings(&self) -> Result { diff --git a/compositor/src/config/layout.rs b/compositor/src/config/layout.rs index c6d25d9..dcebe14 100644 --- a/compositor/src/config/layout.rs +++ b/compositor/src/config/layout.rs @@ -1,4 +1,7 @@ -use super::*; +use super::{ + ColumnDisplayValue, ColumnWidth, ColumnWidthValue, Config, ConfigError, FocusStrategyValue, + GapConfig, LayoutMode, LayoutModeValue, ViewportFocusStrategy, +}; impl Config { pub fn default_column_display(&self) -> ferese_layout::ColumnDisplay { diff --git a/compositor/src/config/outputs.rs b/compositor/src/config/outputs.rs index b9c7d79..049430c 100644 --- a/compositor/src/config/outputs.rs +++ b/compositor/src/config/outputs.rs @@ -1,4 +1,4 @@ -use super::*; +use super::{Config, ConfigError, Deserialize, HashSet, default_true}; impl Config { pub fn output_profiles(&self) -> Result, ConfigError> { diff --git a/compositor/src/config/tab_indicator.rs b/compositor/src/config/tab_indicator.rs index b1539d0..13225a1 100644 --- a/compositor/src/config/tab_indicator.rs +++ b/compositor/src/config/tab_indicator.rs @@ -1,4 +1,4 @@ -use super::*; +use super::{Config, ConfigError, Deserialize, parse_color}; #[derive(Clone, Debug, Deserialize)] #[serde(default, deny_unknown_fields)] diff --git a/compositor/src/handlers/activation.rs b/compositor/src/handlers/activation.rs index b622c12..9161a47 100644 --- a/compositor/src/handlers/activation.rs +++ b/compositor/src/handlers/activation.rs @@ -2,7 +2,8 @@ use std::collections::VecDeque; use std::time::{Duration, Instant}; use smithay::input::Seat; -use smithay::reexports::wayland_server::{Resource, backend::ClientId}; +use smithay::reexports::wayland_server::Resource; +use smithay::reexports::wayland_server::backend::ClientId; use smithay::utils::Serial; use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface; diff --git a/compositor/src/handlers/dispatch.rs b/compositor/src/handlers/dispatch.rs index 4eea0c1..ef9136e 100644 --- a/compositor/src/handlers/dispatch.rs +++ b/compositor/src/handlers/dispatch.rs @@ -1,7 +1,7 @@ use crate::Ferese; +use smithay::reexports::wayland_server::backend::ClientId; use smithay::reexports::wayland_server::{ - Client, DataInit, Dispatch, DisplayHandle, GlobalDispatch, New, Resource, backend::ClientId, - protocol as wl, + Client, DataInit, Dispatch, DisplayHandle, GlobalDispatch, New, Resource, protocol as wl, }; use smithay::reexports::{ wayland_protocols as protocols, wayland_protocols_misc as misc, wayland_protocols_wlr as wlr, diff --git a/compositor/src/handlers/gamma_control.rs b/compositor/src/handlers/gamma_control.rs index 41390fa..f660f5f 100644 --- a/compositor/src/handlers/gamma_control.rs +++ b/compositor/src/handlers/gamma_control.rs @@ -9,7 +9,9 @@ use smithay::reexports::wayland_server::{ Client, DataInit, Dispatch, DisplayHandle, GlobalDispatch, New, Resource, }; -use crate::{Ferese, backends::direct::gamma, gamma::Ramp}; +use crate::Ferese; +use crate::backends::direct::gamma; +use crate::gamma::Ramp; pub(crate) fn init_global(display: &DisplayHandle) { display.create_global::(1, ()); diff --git a/compositor/src/handlers/screenshot.rs b/compositor/src/handlers/screenshot.rs index 0e86774..59a8a6a 100644 --- a/compositor/src/handlers/screenshot.rs +++ b/compositor/src/handlers/screenshot.rs @@ -1,11 +1,9 @@ //! Converts output-buffer readback into upright image coordinates. use std::path::{Path, PathBuf}; +use std::sync::Arc; +use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::mpsc::SyncSender as ReplySender; -use std::sync::{ - Arc, - atomic::{AtomicUsize, Ordering}, -}; use std::time::{Duration, Instant}; use ferese_ipc::Response; @@ -1954,10 +1952,10 @@ mod tests { fn conversion_does_not_flip_vertically() { // Top row red, bottom row blue. An extra Y flip would swap them. let mut f = frame(Transform::Normal, 1, 2); - f.pixels = vec![0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00]; + f.pixels = vec![0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00]; let out = scale_and_convert(&f, 1, 2).unwrap(); - assert_eq!(&out[0..4], &[0xFF, 0x00, 0x00, 255], "top row"); - assert_eq!(&out[4..8], &[0x00, 0x00, 0xFF, 255], "bottom row"); + assert_eq!(&out[0..4], &[0xff, 0x00, 0x00, 255], "top row"); + assert_eq!(&out[4..8], &[0x00, 0x00, 0xff, 255], "bottom row"); } #[test] @@ -1971,7 +1969,7 @@ mod tests { let value = (row * 2 + column) as u8; padded.extend_from_slice(&[value, value, value, 255]); } - padded.extend_from_slice(&[0xEE; 4]); + padded.extend_from_slice(&[0xee; 4]); } f.pixels = padded; diff --git a/compositor/src/idle_inhibition/media.rs b/compositor/src/idle_inhibition/media.rs index 47515e5..c12e4d5 100644 --- a/compositor/src/idle_inhibition/media.rs +++ b/compositor/src/idle_inhibition/media.rs @@ -7,7 +7,8 @@ use std::time::Instant; use calloop::EventLoop; use calloop::channel::{Event, sync_channel}; -use ferese_ipc::{Response, media::Snapshot}; +use ferese_ipc::Response; +use ferese_ipc::media::Snapshot; use serde_json::Value; use crate::Ferese; diff --git a/compositor/src/idle_inhibition/media/bus.rs b/compositor/src/idle_inhibition/media/bus.rs index cf3d015..e9ebea8 100644 --- a/compositor/src/idle_inhibition/media/bus.rs +++ b/compositor/src/idle_inhibition/media/bus.rs @@ -2,10 +2,8 @@ use std::collections::HashMap; use std::time::Duration; use calloop::channel::SyncSender; -use ferese_ipc::{ - Response, - media::{Playback, now_us}, -}; +use ferese_ipc::Response; +use ferese_ipc::media::{Playback, now_us}; use futures_lite::{StreamExt, future, stream}; use zbus::zvariant::{Array, OwnedObjectPath, OwnedValue, Value}; use zbus::{Connection, MatchRule, MessageStream}; diff --git a/compositor/src/input/binding_mode_tests.rs b/compositor/src/input/binding_mode_tests.rs index 5ff0de6..6ea0bb5 100644 --- a/compositor/src/input/binding_mode_tests.rs +++ b/compositor/src/input/binding_mode_tests.rs @@ -2,7 +2,8 @@ use super::*; use smithay::backend::input::UnusedEvent; use smithay::backend::winit::WinitVirtualDevice; use smithay::input::keyboard::Keycode; -use smithay::reexports::{calloop::EventLoop, wayland_server::Display}; +use smithay::reexports::calloop::EventLoop; +use smithay::reexports::wayland_server::Display; #[derive(Debug)] struct TestInput; diff --git a/compositor/src/input/layer_focus_tests.rs b/compositor/src/input/layer_focus_tests.rs index 26a9489..c7c27c9 100644 --- a/compositor/src/input/layer_focus_tests.rs +++ b/compositor/src/input/layer_focus_tests.rs @@ -1,13 +1,14 @@ use super::*; -use crate::state::ClientState; use crate::state::{ - dispatch_test_client as dispatch, test_client_request as request, test_window as window, + ClientState, dispatch_test_client as dispatch, test_client_request as request, + test_window as window, }; use smithay::desktop::{LayerSurface, layer_map_for_output}; use smithay::output::{Mode, Output, PhysicalProperties, Subpixel}; use smithay::reexports::calloop::EventLoop; use smithay::reexports::wayland_protocols_wlr::layer_shell::v1::server::zwlr_layer_shell_v1::ZwlrLayerShellV1; -use smithay::reexports::wayland_server::protocol::{wl_compositor::WlCompositor, wl_shm::WlShm}; +use smithay::reexports::wayland_server::protocol::wl_compositor::WlCompositor; +use smithay::reexports::wayland_server::protocol::wl_shm::WlShm; use std::io::{Read, Write}; use std::os::fd::AsRawFd; use std::os::unix::net::UnixStream; diff --git a/compositor/src/ipc_events.rs b/compositor/src/ipc_events.rs index c4fe561..fca9a49 100644 --- a/compositor/src/ipc_events.rs +++ b/compositor/src/ipc_events.rs @@ -254,7 +254,8 @@ mod tests { fn topology_events_wait_for_publication_and_report_config_commits() { use crate::state::DesktopOutput; use smithay::output::{Mode, Output, PhysicalProperties, Scale, Subpixel}; - use smithay::reexports::{calloop::EventLoop, wayland_server::Display}; + use smithay::reexports::calloop::EventLoop; + use smithay::reexports::wayland_server::Display; use smithay::utils::Transform; if !crate::startup_tests::private_runtime( diff --git a/compositor/src/process/supervisor.rs b/compositor/src/process/supervisor.rs index e104e8c..3d78d5e 100644 --- a/compositor/src/process/supervisor.rs +++ b/compositor/src/process/supervisor.rs @@ -1,6 +1,9 @@ //! Supervise the explicitly opted-in desktop helper. Each generation gets new //! private Wayland connections; a dead generation's descriptors are never reused. -use super::*; +use super::{ + Child, ClientCapabilities, Duration, Ferese, Generic, Interest, LoopHandle, Mode, PostAction, + Rc, RefCell, TimeoutAction, Timer, io, pidfd, spawn_client_inner, terminate_child, warn, +}; use calloop::RegistrationToken; use std::ffi::OsString; use std::time::Instant; diff --git a/compositor/src/render/backdrop.rs b/compositor/src/render/backdrop.rs index fd1e568..e3ca0ba 100644 --- a/compositor/src/render/backdrop.rs +++ b/compositor/src/render/backdrop.rs @@ -1,4 +1,7 @@ -use super::*; +use super::{ + AnimatedWindowRenderElement, Buffer, CommitCounter, Element, Id, Ordering, Physical, Rectangle, + RenderScale, Transform, +}; #[derive(Clone, Debug, Default)] pub(super) struct Backdrop { @@ -132,6 +135,12 @@ pub(super) fn update(elements: &[AnimatedWindowRenderElement], scale: f64) { #[cfg(test)] mod tests { + #[cfg(test)] + use smithay::backend::renderer::utils::DamageSet; + #[cfg(test)] + use smithay::backend::renderer::utils::OpaqueRegions; + use std::sync::Arc; + use super::*; struct TestElement { diff --git a/compositor/src/render/capture.rs b/compositor/src/render/capture.rs index a9cf8aa..b8fa23d 100644 --- a/compositor/src/render/capture.rs +++ b/compositor/src/render/capture.rs @@ -1,4 +1,10 @@ -use super::*; +use super::{ + Arc, Bind, Color32F, CommitCounter, Duration, ExportMem, Ferese, Fourcc, Frame, GlesError, + GlesRenderer, GlesTexture, Id, Logical, Offscreen, Physical, Point, Rectangle, + RenderElementKind, Renderer, ResizeSnapshot, Size, Texture, Transform, + WaylandSurfaceRenderElement, cursor_elements, draw_render_elements, + render_elements_from_surface_tree, +}; #[derive(Default)] struct CaptureTarget(std::sync::Mutex>); diff --git a/compositor/src/render/closing.rs b/compositor/src/render/closing.rs index eaefacf..7e72742 100644 --- a/compositor/src/render/closing.rs +++ b/compositor/src/render/closing.rs @@ -1,4 +1,8 @@ -use super::*; +use super::{ + AnimatedWindowRenderElement, CornerShape, Duration, Ferese, GlesRenderer, MaterialSurface, + Output, Renderer, ResizeSnapshot, RoundedRect, corner_program, material_element_with_role, + rounded_visual_rect, window_border_element, window_shadow_element, window_tint_element, +}; use ferese_animation::{CrossingPolicy, SpringConfig}; use ferese_core::OutputId; use ferese_layout::WindowId; diff --git a/compositor/src/render/corner_tests.rs b/compositor/src/render/corner_tests.rs index 10707c3..85b7f54 100644 --- a/compositor/src/render/corner_tests.rs +++ b/compositor/src/render/corner_tests.rs @@ -207,7 +207,7 @@ fn window_corner_shader_timing_sample() { let mut renderer = renderer(); let driver = renderer .with_context(|gl| { - unsafe { std::ffi::CStr::from_ptr(gl.GetString(0x1F01).cast()) } + unsafe { std::ffi::CStr::from_ptr(gl.GetString(0x1f01).cast()) } .to_string_lossy() .into_owned() }) diff --git a/compositor/src/render/decorations.rs b/compositor/src/render/decorations.rs index 55cdbe0..ac2bfcd 100644 --- a/compositor/src/render/decorations.rs +++ b/compositor/src/render/decorations.rs @@ -1,4 +1,14 @@ -use super::*; +use super::{ + AnimatedWindowRenderElement, BorderParameters, CachedBorder, CachedShadow, ConstrainAlign, + ConstrainScaleBehavior, CornerShape, GlesRenderer, Logical, Output, Physical, + PhysicalShaderElement, Point, PopupManager, ROUNDED_BORDER_SHADER, ROUNDED_SOLID_SHADER, + ROUNDED_TEXTURE_SHADER, Rectangle, RenderElementKind, RenderResources, Renderer, + RoundedClipPrograms, RoundedRect, RoundedSurfaceRenderElement, ShadowParameters, + SharedPixelShaderElement, Size, Transform, Uniform, UniformName, UniformType, + WINDOW_SHADOW_SHADER, WaylandSurfaceRenderElement, WindowContentRenderElement, clamp_radius, + constrain_render_elements, corner_shader_for, material_program_for_corners, + render_elements_from_surface_tree, +}; pub(super) fn rounded_clip_program( resources: &mut RenderResources, @@ -529,9 +539,6 @@ pub(super) fn resize_content_behavior(intentional_scale: bool) -> ConstrainScale } } -#[cfg(test)] -pub(super) use crate::presentation::scaled_visual_rect; - pub(super) fn color_with_alpha(mut color: [f32; 4], alpha: f32) -> [f32; 4] { color[3] *= alpha; color diff --git a/compositor/src/render/materials.rs b/compositor/src/render/materials.rs index f8fd2f8..ae90bfc 100644 --- a/compositor/src/render/materials.rs +++ b/compositor/src/render/materials.rs @@ -1,4 +1,15 @@ -use super::*; +use super::{ + AnimatedWindowRenderElement, Arc, AtomicBool, BLUR_SHADER, BlurCapture, BlurProgram, + BlurRenderElement, CachedMaterial, CommitCounter, CornerShape, CropRenderElement, DamageSet, + Element, Ferese, Fourcc, GlesRenderer, GlesTexture, Logical, MATERIAL_SHADER, MaterialElement, + MaterialParameters, MaterialProgram, Offscreen, Output, PanelMatrices, Physical, + PhysicalShaderElement, Point, Rectangle, Relocate, RelocateRenderElement, RenderElementKind, + RenderResources, Renderer, RescaleRenderElement, RoundedRect, RoundedSurfaceRenderElement, + SharedPixelShaderElement, Size, Texture, Transform, Uniform, UniformName, UniformType, + WaylandSurfaceRenderElement, WindowContentRenderElement, clamp_radius, corner_shader, + corner_shader_for, framebuffer_clip_rect, render_elements_from_surface_tree, + rounded_clip_program, shadow_bounds, +}; #[allow(clippy::too_many_arguments)] pub(super) fn append_material_surface( diff --git a/compositor/src/render/mod.rs b/compositor/src/render/mod.rs index ab9983b..2599039 100644 --- a/compositor/src/render/mod.rs +++ b/compositor/src/render/mod.rs @@ -22,9 +22,18 @@ use std::time::Duration; pub(crate) use capture::{ capture_resize_snapshot, capture_window_buffer, capture_window_frame, convert_window_pixels, }; -use decorations::*; -use materials::*; -use overview::*; +use decorations::{ + border_uniforms, color_with_alpha, corner_program, framebuffer_clip_rect, + resize_content_behavior, rounded_clip_program, rounded_visual_rect, rounded_window_elements, + shadow_bounds, tint_uniforms, window_border_element, window_shadow_element, + window_tint_element, +}; +use materials::{ + MaterialSurface, append_material_surface, blur_damage, blur_program, blur_uniforms, + expanded_blur_region, framebuffer_capture_rect, material_element, material_element_with_role, + material_program, material_program_for_corners, +}; +use overview::{overview_chrome_element, overview_strip_elements}; pub(crate) use resources::RenderResources; use scene::cursor_elements; pub(crate) use scene::{ @@ -654,14 +663,18 @@ where #[cfg(test)] mod tests { + use super::decorations::border_gradient_line; + use crate::presentation::scaled_visual_rect; + use crate::render::materials::blur_uniform_names; + use crate::render::materials::material_blur_radius; use smithay::backend::renderer::damage::OutputDamageTracker; use smithay::backend::renderer::element::{Element, Id}; use smithay::backend::renderer::utils::CommitCounter; use smithay::utils::{Buffer, Logical, Physical, Rectangle, Scale, Transform}; use super::{ - border_gradient_line, color_with_alpha, framebuffer_clip_rect, resize_content_behavior, - rounded_visual_rect, scaled_visual_rect, shadow_bounds, + color_with_alpha, framebuffer_clip_rect, resize_content_behavior, rounded_visual_rect, + shadow_bounds, }; #[test] @@ -782,7 +795,7 @@ mod tests { let program = renderer .compile_custom_texture_shader( super::corner_shader(super::BLUR_SHADER), - &super::blur_uniform_names(), + &blur_uniform_names(), ) .unwrap(); let size = (32, 32).into(); @@ -1184,21 +1197,18 @@ mod tests { fn translucent_materials_blur_at_full_opacity() { use crate::config::MaterialStyle; assert_eq!( - super::material_blur_radius(MaterialStyle::Translucent, 0.0, 18.0), + material_blur_radius(MaterialStyle::Translucent, 0.0, 18.0), 0.0 ); assert_eq!( - super::material_blur_radius(MaterialStyle::Translucent, 1.0, 18.0), + material_blur_radius(MaterialStyle::Translucent, 1.0, 18.0), 18.0 ); assert_eq!( - super::material_blur_radius(MaterialStyle::Translucent, 0.79, 18.0), + material_blur_radius(MaterialStyle::Translucent, 0.79, 18.0), 18.0 ); - assert_eq!( - super::material_blur_radius(MaterialStyle::Solid, 0.79, 18.0), - 0.0 - ); + assert_eq!(material_blur_radius(MaterialStyle::Solid, 0.79, 18.0), 0.0); } #[test] diff --git a/compositor/src/render/overview.rs b/compositor/src/render/overview.rs index 620d28a..f73da83 100644 --- a/compositor/src/render/overview.rs +++ b/compositor/src/render/overview.rs @@ -1,4 +1,12 @@ -use super::*; +use super::{ + AnimatedWindowRenderElement, BorderParameters, CachedBorder, ConstrainScaleBehavior, + CropRenderElement, Ferese, GlesRenderer, HashMap, Logical, MemoryRenderBufferRenderElement, + Output, OverviewChromePart, OverviewScrim, Physical, PhysicalShaderElement, Point, Rectangle, + Relocate, RelocateRenderElement, RenderElementKind, Renderer, RescaleRenderElement, + RoundedRect, SharedPixelShaderElement, border_uniforms, corner_program, framebuffer_clip_rect, + material_program, physical_rect, rounded_clip_program, rounded_visual_rect, + rounded_window_elements, tint_uniforms, window_corner_shape, +}; #[allow(clippy::too_many_arguments)] pub(super) fn overview_chrome_element( diff --git a/compositor/src/render/resources.rs b/compositor/src/render/resources.rs index 3c98a9a..59e337c 100644 --- a/compositor/src/render/resources.rs +++ b/compositor/src/render/resources.rs @@ -1,8 +1,25 @@ use ferese_core::OutputId; +#[cfg(test)] +use smithay::backend::allocator::Fourcc; +#[cfg(test)] +use smithay::backend::renderer::Offscreen; +#[cfg(test)] +use smithay::backend::renderer::element::Id; +#[cfg(test)] +use smithay::backend::renderer::gles::GlesRenderer; +#[cfg(test)] +use smithay::backend::renderer::gles::GlesTexture; +#[cfg(test)] +use smithay::backend::renderer::utils::CommitCounter; + use ferese_layout::WindowId; use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface; -use super::*; +use super::{ + BlurProgram, ClosedWindow, CornerShape, ErasedContextId, HashMap, MaterialBuffers, + MaterialProgram, OverviewChromePart, OverviewScrim, ResizeSnapshot, RoundedClipPrograms, + WindowBorderBuffers, WindowShadowBuffers, +}; /// Resource ownership follows the lifetime of a window, output, surface or GL /// context. Desktop policy and animation values do not live in these caches. @@ -208,6 +225,11 @@ impl RenderResources { #[cfg(test)] mod tests { use super::*; + use crate::render::blur_program; + use crate::render::material_program; + use crate::render::rounded_clip_program; + use smithay::backend::renderer::Renderer; + use std::time::Duration; #[test] fn window_removal_releases_all_its_caches_without_removing_other_windows() { diff --git a/compositor/src/render/scene.rs b/compositor/src/render/scene.rs index 01e6271..afe1cff 100644 --- a/compositor/src/render/scene.rs +++ b/compositor/src/render/scene.rs @@ -1,6 +1,23 @@ use smithay::desktop::Window; -use super::*; +#[cfg(test)] +use smithay::backend::renderer::element::Id; +#[cfg(test)] +use smithay::backend::renderer::utils::CommitCounter; + +use super::{ + AnimatedWindowRenderElement, ConstrainAlign, ConstrainBehavior, ConstrainReference, + CropRenderElement, CursorImageStatus, CursorImageSurfaceData, Duration, Ferese, + FrameEffectMetrics, GlesRenderer, Layer, LayerSurface, Logical, MaterialSurface, + MemoryRenderBufferRenderElement, Output, Physical, Point, PopupManager, Rectangle, Relocate, + RelocateRenderElement, RenderElementKind, Renderer, RescaleRenderElement, Resource, + RoundedRect, Size, SolidColorRenderElement, Transform, WaylandSurfaceRenderElement, + append_material_surface, backdrop, constrain_space_element, corner_program, + layer_map_for_output, material_element, overview_strip_elements, + render_elements_from_surface_tree, resize_content_behavior, rounded_visual_rect, + rounded_window_elements, window_border_element, window_corner_shape, window_shadow_element, + window_tint_element, with_states, +}; pub(crate) fn animated_window_elements( state: &mut Ferese, @@ -602,6 +619,7 @@ pub(super) fn cursor_elements( #[cfg(test)] mod layer_crop_tests { use super::*; + use smithay::backend::renderer::element::Element; #[test] fn layer_crop_keeps_bottom_edge_content_in_every_output_transform() { diff --git a/compositor/src/render/tab_indicator.rs b/compositor/src/render/tab_indicator.rs index 4918bd3..24e1b1e 100644 --- a/compositor/src/render/tab_indicator.rs +++ b/compositor/src/render/tab_indicator.rs @@ -1,4 +1,9 @@ -use super::*; +use super::{ + AnimatedWindowRenderElement, CropRenderElement, Ferese, GlesRenderer, Logical, + MemoryRenderBufferRenderElement, Output, OverviewChromePart, Physical, Point, Rectangle, + Relocate, RelocateRenderElement, RenderElementKind, RescaleRenderElement, color_with_alpha, + overview_chrome_element, physical_rect, +}; use ferese_layout::{Rect, TabBar, WindowId}; #[allow(clippy::too_many_arguments)] diff --git a/compositor/src/render/tabs.rs b/compositor/src/render/tabs.rs index e8ffa59..6e4390a 100644 --- a/compositor/src/render/tabs.rs +++ b/compositor/src/render/tabs.rs @@ -1,4 +1,9 @@ -use super::*; +use super::{ + AnimatedWindowRenderElement, CropRenderElement, Ferese, GlesRenderer, + MemoryRenderBufferRenderElement, Output, OverviewChromePart, Physical, Point, Rectangle, + Relocate, RelocateRenderElement, RenderElementKind, RescaleRenderElement, + overview_chrome_element, physical_rect, +}; pub(super) fn tab_elements( state: &mut Ferese, diff --git a/compositor/src/render/window_blur.rs b/compositor/src/render/window_blur.rs index 4d92429..b46f32d 100644 --- a/compositor/src/render/window_blur.rs +++ b/compositor/src/render/window_blur.rs @@ -1,4 +1,8 @@ -use super::*; +use super::{ + AnimatedWindowRenderElement, Arc, AtomicBool, BlurRenderElement, Ferese, Fourcc, GlesRenderer, + GlesTexture, MaterialParameters, Offscreen, Output, Rectangle, Renderer, RoundedRect, Size, + Texture, blur_program, expanded_blur_region, framebuffer_capture_rect, framebuffer_clip_rect, +}; #[derive(Debug)] pub(super) struct WindowBlur { diff --git a/compositor/src/render/window_content.rs b/compositor/src/render/window_content.rs index e5f43a2..deaf30d 100644 --- a/compositor/src/render/window_content.rs +++ b/compositor/src/render/window_content.rs @@ -1,5 +1,27 @@ //! Live, overview and retained views use the same snapshot mapping and clip. -use super::*; +#[cfg(test)] +use crate::presentation::CornerShape; +#[cfg(test)] +use smithay::backend::allocator::Fourcc; +#[cfg(test)] +use smithay::backend::renderer::Color32F; +#[cfg(test)] +use smithay::backend::renderer::element::Id; +#[cfg(test)] +use smithay::backend::renderer::gles::GlesRenderer; +#[cfg(test)] +use smithay::backend::renderer::gles::GlesTexture; +#[cfg(test)] +use smithay::backend::renderer::utils::CommitCounter; +#[cfg(test)] +use smithay::backend::renderer::utils::draw_render_elements; +#[cfg(test)] +use smithay::utils::Transform; + +use super::{ + NativeTextureElement, Output, Rectangle, ResizeSnapshot, RoundedClipPrograms, RoundedRect, + Size, Texture, Uniform, framebuffer_clip_rect, +}; pub(super) fn snapshot_element( snapshot: &ResizeSnapshot, @@ -60,6 +82,15 @@ pub(super) fn snapshot_element( #[cfg(test)] mod tests { use super::*; + use crate::render::AnimatedWindowRenderElement; + use crate::render::RenderResources; + use crate::render::corner_program; + use smithay::backend::renderer::Bind; + use smithay::backend::renderer::ExportMem; + use smithay::backend::renderer::Frame; + use smithay::backend::renderer::Offscreen; + use smithay::backend::renderer::Renderer; + use std::time::Duration; #[test] #[ignore = "requires an EGL rendering device"] diff --git a/compositor/src/startup_tests.rs b/compositor/src/startup_tests.rs index 050001b..ce01a8d 100644 --- a/compositor/src/startup_tests.rs +++ b/compositor/src/startup_tests.rs @@ -10,9 +10,8 @@ use calloop::EventLoop; use calloop::signals::{Signal, Signals}; use smithay::input::SeatHandler; use smithay::input::pointer::{CursorImageStatus, MotionEvent}; -use smithay::reexports::wayland_server::protocol::{ - wl_compositor::WlCompositor, wl_surface::WlSurface, -}; +use smithay::reexports::wayland_server::protocol::wl_compositor::WlCompositor; +use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface; use smithay::reexports::wayland_server::{Display, Resource}; use smithay::utils::SERIAL_COUNTER; diff --git a/compositor/src/state.rs b/compositor/src/state.rs index d2ea774..b204429 100644 --- a/compositor/src/state.rs +++ b/compositor/src/state.rs @@ -119,9 +119,6 @@ use crate::wallpaper::{WallpaperConfig, WallpaperState}; use crate::window_rules::{WindowRule, resolve as resolve_window_rules}; use crate::winit::NestedBackend; -#[cfg(test)] -use ferese_animation::CrossingPolicy; - #[cfg(test)] const SLIDE_SETTLE_TEST_BUDGET: Duration = Duration::from_secs(2); diff --git a/compositor/src/state/animation.rs b/compositor/src/state/animation.rs index e8793fe..bb262c0 100644 --- a/compositor/src/state/animation.rs +++ b/compositor/src/state/animation.rs @@ -1,4 +1,10 @@ -use super::*; +#[cfg(any(test, feature = "resize-metrics"))] +use super::viewport::ViewportPresentation; +use super::{ + AnimatedValue, ClientSize, DrmEventTime, DrmNode, Duration, Ferese, HashMap, HashSet, Instant, + OutputId, PopupManager, SpringConfig, WindowGeometry, WindowId, WorkspaceId, crtc, + scaled_animation_duration, +}; impl Ferese { pub(super) fn presentation_now(&self) -> Duration { @@ -740,8 +746,22 @@ fn record_needs_tick( #[cfg(test)] mod tests { + use crate::state::BoundedFade; + #[cfg(test)] + use calloop::EventLoop; + #[cfg(test)] + use ferese_animation::CrossingPolicy; + #[cfg(test)] + use ferese_animation::PresentationMode; + #[cfg(test)] + use ferese_layout::Axis; + #[cfg(test)] + use ferese_layout::Rect; + use super::super::window_registry::WindowRecord; use super::*; + use smithay::output::Output; + use smithay::reexports::wayland_server::Display; fn settled() -> WindowRecord { let rect = Rect::new(0.0, 0.0, 400.0, 300.0); diff --git a/compositor/src/state/capture_privacy_tests.rs b/compositor/src/state/capture_privacy_tests.rs index cd22eef..8402a39 100644 --- a/compositor/src/state/capture_privacy_tests.rs +++ b/compositor/src/state/capture_privacy_tests.rs @@ -13,7 +13,8 @@ use smithay::desktop::Window; use smithay::output::{Mode, Output, PhysicalProperties, Scale, Subpixel}; use smithay::reexports::calloop::EventLoop; use smithay::reexports::wayland_protocols::xdg::shell::server::xdg_wm_base::XdgWmBase; -use smithay::reexports::wayland_server::protocol::{wl_compositor::WlCompositor, wl_shm::WlShm}; +use smithay::reexports::wayland_server::protocol::wl_compositor::WlCompositor; +use smithay::reexports::wayland_server::protocol::wl_shm::WlShm; use smithay::reexports::wayland_server::{Display, Resource}; use smithay::utils::{Rectangle, Transform}; use smithay::wayland::compositor::with_states; @@ -852,7 +853,8 @@ fn capture_privacy_pixels_and_policy_transitions() { // A stationary client's cursor is a separate surface and can outlive its // protected toplevel. Never reveal that retained image after an opt-out or close. - use smithay::input::{SeatHandler, pointer::CursorImageStatus}; + use smithay::input::SeatHandler; + use smithay::input::pointer::CursorImageStatus; use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface; let client = secret.toplevel().unwrap().wl_surface().client().unwrap(); let compositor = client diff --git a/compositor/src/state/floating.rs b/compositor/src/state/floating.rs index 4d7e9dc..d8d0b94 100644 --- a/compositor/src/state/floating.rs +++ b/compositor/src/state/floating.rs @@ -1,4 +1,9 @@ -use super::*; +use super::{ + Axis, ColumnWidth, Direction, Ferese, Layer, Logical, Output, Point, Rect, Size, + SizeConstraints, SurfaceCachedState, Window, WindowGeometry, WindowId, WindowPlacement, + WlSurface, WorkspaceLayout, XdgToplevelSurfaceData, centered_floating_rect, client_size, + constrained_floating_rect, layer_map_for_output, with_states, +}; impl Ferese { pub(super) fn adjust_floating_direction( diff --git a/compositor/src/state/focus.rs b/compositor/src/state/focus.rs index fabf3c6..52ca539 100644 --- a/compositor/src/state/focus.rs +++ b/compositor/src/state/focus.rs @@ -1,4 +1,4 @@ -use super::*; +use super::{Ferese, OutputId, WindowId, WindowPlacement}; impl Ferese { pub(super) fn focus_candidates(&self) -> Vec { @@ -142,6 +142,7 @@ impl Ferese { mod tests { use super::*; use crate::state::capture_privacy::tests::window; + use smithay::output::Output; use smithay::reexports::calloop::EventLoop; use std::os::unix::net::UnixStream; diff --git a/compositor/src/state/hit_testing.rs b/compositor/src/state/hit_testing.rs index 0f800b8..685fd02 100644 --- a/compositor/src/state/hit_testing.rs +++ b/compositor/src/state/hit_testing.rs @@ -1,4 +1,8 @@ -use super::*; +use super::{ + ClientSize, CursorImageStatus, Ferese, Layer, LayerSurface, Logical, Output, Point, Rectangle, + Window, WindowId, WindowSurfaceType, WlSurface, WorkspaceId, layer_map_for_output, + send_frames_surface_tree, window_has_buffer, +}; impl Ferese { pub fn surface_under( diff --git a/compositor/src/state/layout.rs b/compositor/src/state/layout.rs index 22ae836..c5eea39 100644 --- a/compositor/src/state/layout.rs +++ b/compositor/src/state/layout.rs @@ -1,4 +1,10 @@ -use super::*; +use super::{ + AnimatedValue, Duration, Ferese, GapConfig, HashMap, HashSet, Instant, LayoutResult, Logical, + Output, Point, PresentationMode, Rect, SizeConstraints, SpaceElement, SurfaceCachedState, + ViewportPresentation, Window, WindowGeometry, WindowId, WindowPlacement, WorkspaceId, + WorkspaceLayout, client_size, constrained_floating_rect, layer_map_for_output, maximized_rect, + restored_scrolling_world_x, stacking_order_settled, with_states, xdg_toplevel, +}; #[derive(Default)] pub(super) struct PreviewCache { diff --git a/compositor/src/state/lifecycle.rs b/compositor/src/state/lifecycle.rs index 40b6b40..7d59a62 100644 --- a/compositor/src/state/lifecycle.rs +++ b/compositor/src/state/lifecycle.rs @@ -1,4 +1,4 @@ -use super::*; +use super::{ClientSize, Ferese, Instant, Window, WlSurface, with_states}; use smithay::wayland::compositor::{BufferAssignment, SurfaceAttributes}; impl Ferese { diff --git a/compositor/src/state/navigation.rs b/compositor/src/state/navigation.rs index e95e521..e0b033c 100644 --- a/compositor/src/state/navigation.rs +++ b/compositor/src/state/navigation.rs @@ -1,4 +1,8 @@ -use super::*; +use super::{ + Axis, Direction, Ferese, FocusSwipe, Instant, LayoutMode, OutputId, SpringConfig, + SwipeDirection, ViewportPresentation, WindowId, WindowPlacement, WorkspaceId, WorkspaceLayout, + WorkspaceSlide, activate_window_workspace, workspace_swipe_is_current, +}; impl Ferese { pub fn focus_direction(&mut self, direction: Direction) { diff --git a/compositor/src/state/outputs.rs b/compositor/src/state/outputs.rs index 9a6ed9f..eb4ee6b 100644 --- a/compositor/src/state/outputs.rs +++ b/compositor/src/state/outputs.rs @@ -1,4 +1,4 @@ -use super::*; +use super::{DesktopOutput, Ferese, Logical, Output, OutputId, Point}; impl Ferese { pub(crate) fn defer_output_redraw(&mut self, output: Output) { @@ -191,6 +191,18 @@ impl Ferese { #[cfg(test)] mod tests { + #[cfg(test)] + use calloop::EventLoop; + #[cfg(test)] + use ferese_animation::WindowGeometry; + #[cfg(test)] + use ferese_layout::Axis; + #[cfg(test)] + use ferese_layout::Rect; + #[cfg(test)] + use ferese_layout::WindowId; + use smithay::reexports::wayland_server::Display; + use super::*; use smithay::backend::input::{ diff --git a/compositor/src/state/panel_clearance_tests.rs b/compositor/src/state/panel_clearance_tests.rs index a5c6d89..c4ba8da 100644 --- a/compositor/src/state/panel_clearance_tests.rs +++ b/compositor/src/state/panel_clearance_tests.rs @@ -1,4 +1,6 @@ use super::*; +use crate::state::ClientState; +use crate::state::DesktopOutput; use smithay::output::{Mode, PhysicalProperties, Scale, Subpixel}; use smithay::reexports::calloop::EventLoop; use smithay::reexports::wayland_protocols_wlr::layer_shell::v1::server::zwlr_layer_shell_v1::ZwlrLayerShellV1; diff --git a/compositor/src/state/prediction.rs b/compositor/src/state/prediction.rs index 2361a0a..64298a6 100644 --- a/compositor/src/state/prediction.rs +++ b/compositor/src/state/prediction.rs @@ -1,4 +1,7 @@ -use super::*; +use super::{ + AnimatedValue, ClientSize, Duration, Ferese, HashMap, Output, SpringConfig, + ViewportPresentation, WindowGeometry, WindowId, +}; /// Output-local presentation values. Sampling never changes authoritative /// geometry, configure barriers, animation clocks, or another output's view. @@ -457,7 +460,20 @@ fn predict_geometry( #[cfg(test)] mod tests { + use crate::state::SwipeDirection; + #[cfg(test)] + use calloop::EventLoop; + #[cfg(test)] + use ferese_animation::CrossingPolicy; + #[cfg(test)] + use ferese_layout::Axis; + #[cfg(test)] + use ferese_layout::Rect; + use super::*; + use crate::state::WorkspaceSlide; + use smithay::reexports::wayland_server::Display; + use std::time::Instant; #[test] fn pending_resize_waits_without_refresh_cadence_and_recovers() { diff --git a/compositor/src/state/presentation_dependencies.rs b/compositor/src/state/presentation_dependencies.rs index 2c1d140..634854b 100644 --- a/compositor/src/state/presentation_dependencies.rs +++ b/compositor/src/state/presentation_dependencies.rs @@ -1,4 +1,19 @@ -use super::*; +use super::{ + Ferese, HashMap, HashSet, Rect, WindowId, WorkspaceId, WorkspaceLayout, window_registry, +}; +#[cfg(test)] +use ferese_animation::SpringConfig; +#[cfg(test)] +use ferese_layout::Axis; +#[cfg(test)] +use ferese_layout::Direction; +#[cfg(test)] +use ferese_layout::GapConfig; +#[cfg(test)] +use ferese_layout::SizeConstraints; +#[cfg(test)] +use ferese_layout::ViewportFocusStrategy; + use smithay::utils::Serial; #[derive(Clone, Copy, Debug, PartialEq)] @@ -518,6 +533,8 @@ impl Ferese { mod tests { use super::*; use crate::resize_transaction::ResizeTransaction; + use crate::state::ViewportPresentation; + use std::time::Duration; fn tree_reflow_groups( motions: impl IntoIterator, diff --git a/compositor/src/state/reconciliation.rs b/compositor/src/state/reconciliation.rs index 0db4777..487a17e 100644 --- a/compositor/src/state/reconciliation.rs +++ b/compositor/src/state/reconciliation.rs @@ -1,5 +1,25 @@ //! Exceptional topology publication. Ordinary input/damage never constructs a plan. -use super::*; +#[cfg(test)] +use calloop::EventLoop; +#[cfg(test)] +use ferese_animation::AnimatedValue; +#[cfg(test)] +use ferese_animation::ClientSize; +#[cfg(test)] +use ferese_animation::WindowGeometry; +#[cfg(test)] +use ferese_layout::WindowId; +#[cfg(test)] +use ferese_protocols::shell::v1::server::ferese_shell_v1::FereseShellV1; +#[cfg(test)] +use smithay::desktop::Space; +#[cfg(test)] +use smithay::desktop::Window; + +use super::{ + Ferese, HashSet, Logical, Output, OutputGeometry, Point, Rect, WindowPlacement, + moved_floating_rect, +}; use smithay::output::{Mode, Scale}; use smithay::utils::Transform; @@ -237,10 +257,17 @@ impl Ferese { #[cfg(test)] mod tests { use super::*; + use crate::state::ClientState; + use crate::state::SwipeDirection; + use crate::state::ViewportPresentation; + use crate::state::WorkspaceSlide; use smithay::output::{PhysicalProperties, Subpixel}; + use smithay::reexports::wayland_server::Display; use smithay::reexports::wayland_server::Resource; use std::io::{Read, Write}; use std::os::unix::net::UnixStream; + use std::sync::Arc; + use std::time::Duration; fn output(name: &str, x: i32, width: i32) -> DesktopOutput { DesktopOutput { diff --git a/compositor/src/state/tab_indicator.rs b/compositor/src/state/tab_indicator.rs index b39a467..ea505ce 100644 --- a/compositor/src/state/tab_indicator.rs +++ b/compositor/src/state/tab_indicator.rs @@ -1,9 +1,10 @@ -use super::*; -use crate::config::TabIndicatorSettings; -use smithay::reexports::calloop::{ - RegistrationToken, - timer::{TimeoutAction, Timer}, +use super::{ + AnimatedValue, Duration, Ferese, Instant, Layer, Logical, Output, Point, Rect, SpringConfig, + WindowId, WorkspaceLayout, }; +use crate::config::TabIndicatorSettings; +use smithay::reexports::calloop::RegistrationToken; +use smithay::reexports::calloop::timer::{TimeoutAction, Timer}; #[derive(Debug)] pub(crate) struct Overlay { diff --git a/compositor/src/state/tabs.rs b/compositor/src/state/tabs.rs index c9e23ba..04ae0a8 100644 --- a/compositor/src/state/tabs.rs +++ b/compositor/src/state/tabs.rs @@ -1,4 +1,6 @@ -use super::*; +use super::{ + Direction, Ferese, Layer, Logical, Point, Rect, WindowId, WorkspaceId, WorkspaceLayout, +}; impl Ferese { pub(crate) fn join_tab(&mut self, direction: Direction) { diff --git a/compositor/src/state/viewport.rs b/compositor/src/state/viewport.rs index de3ddcc..3aa1324 100644 --- a/compositor/src/state/viewport.rs +++ b/compositor/src/state/viewport.rs @@ -1,4 +1,4 @@ -use super::*; +use super::{AnimatedValue, Duration, Ferese, FocusSwipe, SpringConfig}; #[derive(Clone, PartialEq)] enum ViewportOwner { @@ -223,7 +223,20 @@ impl Ferese { #[cfg(test)] mod tests { + use crate::state::SwipeDirection; + #[cfg(test)] + use ferese_animation::WindowGeometry; + #[cfg(test)] + use ferese_core::WorkspaceId; + #[cfg(test)] + use ferese_layout::Direction; + #[cfg(test)] + use ferese_layout::Rect; + #[cfg(test)] + use ferese_layout::WindowId; + use super::*; + use crate::state::restored_scrolling_world_x; const TICK: Duration = Duration::from_millis(16); diff --git a/compositor/src/state/window_lifecycle_tests.rs b/compositor/src/state/window_lifecycle_tests.rs index 58a913e..8b631e9 100644 --- a/compositor/src/state/window_lifecycle_tests.rs +++ b/compositor/src/state/window_lifecycle_tests.rs @@ -1522,10 +1522,8 @@ fn shell_can_move_a_window_to_the_current_workspace_on_another_output() { } fn change_transient_parent(state: &mut Ferese, child: &Window, parent: Option<&Window>) { - use smithay::wayland::{ - compositor::with_states, - shell::xdg::{XdgShellHandler, XdgToplevelSurfaceData}, - }; + use smithay::wayland::compositor::with_states; + use smithay::wayland::shell::xdg::{XdgShellHandler, XdgToplevelSurfaceData}; let toplevel = child.toplevel().unwrap(); with_states(toplevel.wl_surface(), |states| { states diff --git a/compositor/src/state/windows.rs b/compositor/src/state/windows.rs index cf308d2..d9bdb68 100644 --- a/compositor/src/state/windows.rs +++ b/compositor/src/state/windows.rs @@ -1,4 +1,9 @@ -use super::*; +use super::{ + AnimatedValue, Axis, ClientSize, Ferese, Instant, Rect, Window, WindowGeometry, WindowId, + WindowPlacement, WindowRule, WlSurface, XdgToplevelSurfaceData, centered_floating_rect, + centered_transient_rect, client_size, floating_commit_is_current, natural_floating_rect, + resolve_window_rules, with_states, xdg_toplevel, +}; impl Ferese { pub(crate) fn window_for_surface(&self, surface: &WlSurface) -> Option { diff --git a/compositor/src/theme.rs b/compositor/src/theme.rs index 11f67b1..2f315d6 100644 --- a/compositor/src/theme.rs +++ b/compositor/src/theme.rs @@ -10,10 +10,8 @@ use calloop::timer::{TimeoutAction, Timer}; use calloop::{Interest, Mode as PollMode, PostAction}; use ferese_config::Document; use ferese_config::theme::{Candidate, Mode, TRANSITION_MS, resolve_with_context}; -use ferese_ipc::{ - Response, - theme::{SCHEMA_VERSION, Snapshot}, -}; +use ferese_ipc::Response; +use ferese_ipc::theme::{SCHEMA_VERSION, Snapshot}; use jiff::Timestamp; use notify::{RecommendedWatcher, RecursiveMode, Watcher}; use serde_json::{Value, json}; diff --git a/compositor/src/xwayland/integration_tests.rs b/compositor/src/xwayland/integration_tests.rs index 6862266..fdf4abc 100644 --- a/compositor/src/xwayland/integration_tests.rs +++ b/compositor/src/xwayland/integration_tests.rs @@ -681,11 +681,10 @@ fn live_dependencies() -> PathBuf { mod manager_loop { use super::*; - use crate::Ferese; use crate::config::{XwaylandConfig, XwaylandStartup}; - use crate::xwayland; use crate::xwayland::lifecycle::Phase; use crate::xwayland::test_hooks; + use crate::{Ferese, xwayland}; use ferese_ipc::xwayland::{Readiness, State}; use smithay::reexports::calloop::EventLoop; use smithay::reexports::wayland_server::Display; diff --git a/crates/ferese-animation/src/gesture.rs b/crates/ferese-animation/src/gesture.rs index 8969edb..e69e8fe 100644 --- a/crates/ferese-animation/src/gesture.rs +++ b/crates/ferese-animation/src/gesture.rs @@ -1,4 +1,5 @@ -use std::{collections::VecDeque, time::Duration}; +use std::collections::VecDeque; +use std::time::Duration; #[derive(Default, Debug)] pub struct VelocityTracker { diff --git a/crates/ferese-ipc/src/theme.rs b/crates/ferese-ipc/src/theme.rs index d683b3e..0a0fbfd 100644 --- a/crates/ferese-ipc/src/theme.rs +++ b/crates/ferese-ipc/src/theme.rs @@ -1,4 +1,5 @@ -use ferese_theme_model::{Mode, ResolvedTheme, families::Family}; +use ferese_theme_model::families::Family; +use ferese_theme_model::{Mode, ResolvedTheme}; use serde::{Deserialize, Serialize}; use serde_json::{Value, json}; diff --git a/crates/ferese-theme/src/palette.rs b/crates/ferese-theme/src/palette.rs index a486626..48fc1e8 100644 --- a/crates/ferese-theme/src/palette.rs +++ b/crates/ferese-theme/src/palette.rs @@ -1,5 +1,6 @@ use cosmic::iced::border::Shape as BorderShape; -use cosmic::iced::{Background, Color, gradient::Linear}; +use cosmic::iced::gradient::Linear; +use cosmic::iced::{Background, Color}; #[derive(Clone, Copy, Debug, PartialEq)] pub struct Palette { diff --git a/crates/ferese-theme/src/panel.rs b/crates/ferese-theme/src/panel.rs index 7c440c5..d1c79bd 100644 --- a/crates/ferese-theme/src/panel.rs +++ b/crates/ferese-theme/src/panel.rs @@ -276,7 +276,8 @@ impl Widget for Adaptive<'_, M> { #[cfg(test)] mod tests { use super::*; - use cosmic::iced::advanced::{clipboard, renderer::Headless}; + use cosmic::iced::advanced::clipboard; + use cosmic::iced::advanced::renderer::Headless; use cosmic::iced::{Font, Pixels, Point}; use cosmic::widget::{button, text}; use ferese_panel::OverflowPolicy; diff --git a/crates/ferese-theme/src/panel_surface.rs b/crates/ferese-theme/src/panel_surface.rs index 0a25ccc..556816c 100644 --- a/crates/ferese-theme/src/panel_surface.rs +++ b/crates/ferese-theme/src/panel_surface.rs @@ -1,6 +1,7 @@ -use cosmic::iced::advanced::Renderer as _; use cosmic::iced::advanced::graphics::geometry::{Cache, Path, Renderer as _, Stroke}; -use cosmic::iced::advanced::{Clipboard, Layout, Shell, Widget, layout, mouse, renderer, widget}; +use cosmic::iced::advanced::{ + Clipboard, Layout, Renderer as _, Shell, Widget, layout, mouse, renderer, widget, +}; use cosmic::iced::{Color, Event, Length, Point, Rectangle, Size, Vector}; use cosmic::{Element, Theme}; use ferese_panel::scene::{GroupBounds, Parameters, Scene}; diff --git a/crates/ferese-theme/src/workspaces.rs b/crates/ferese-theme/src/workspaces.rs index 3b082ec..658be83 100644 --- a/crates/ferese-theme/src/workspaces.rs +++ b/crates/ferese-theme/src/workspaces.rs @@ -237,9 +237,9 @@ pub fn sample<'a, M: 'a>( #[cfg(test)] mod tests { use super::*; - use cosmic::iced::advanced::{ - Layout, Renderer, layout, renderer, renderer::Headless, widget::Tree, - }; + use cosmic::iced::advanced::renderer::Headless; + use cosmic::iced::advanced::widget::Tree; + use cosmic::iced::advanced::{Layout, Renderer, layout, renderer}; use cosmic::iced::{Font, Pixels, Rectangle, Size, mouse}; #[test] diff --git a/feresectl/src/activities/setup.rs b/feresectl/src/activities/setup.rs index 4347d3f..8dc2e29 100644 --- a/feresectl/src/activities/setup.rs +++ b/feresectl/src/activities/setup.rs @@ -1,6 +1,8 @@ -use ferese_config::{Document, file::ConfigFile, panel}; +use ferese_config::file::ConfigFile; +use ferese_config::{Document, panel}; use serde_json::json; -use std::{error::Error, path::Path}; +use std::error::Error; +use std::path::Path; fn prepare(source: &str) -> Result> { let mut doc = Document::parse(source)?; diff --git a/feresectl/src/activities/transport.rs b/feresectl/src/activities/transport.rs index 8fc5fa2..7deacd5 100644 --- a/feresectl/src/activities/transport.rs +++ b/feresectl/src/activities/transport.rs @@ -1,7 +1,8 @@ //! A complete exchange has one deadline, including a full Unix listen backlog. use std::io::{self, Read, Write}; use std::os::fd::{AsRawFd, FromRawFd}; -use std::os::unix::{ffi::OsStrExt, net::UnixStream}; +use std::os::unix::ffi::OsStrExt; +use std::os::unix::net::UnixStream; use std::path::Path; use std::time::{Duration, Instant}; diff --git a/feresectl/src/pomodoro.rs b/feresectl/src/pomodoro.rs index 748c685..6d9ca50 100644 --- a/feresectl/src/pomodoro.rs +++ b/feresectl/src/pomodoro.rs @@ -1,6 +1,9 @@ use clap::Subcommand; use ferese_ipc::activities::{PomodoroAction, PomodoroRequest, VERSION}; -use std::{error::Error, os::unix::net::UnixStream, path::Path, time::Duration}; +use std::error::Error; +use std::os::unix::net::UnixStream; +use std::path::Path; +use std::time::Duration; #[derive(Debug, Subcommand)] pub enum Action { diff --git a/shell/ferese-settings/src/main.rs b/shell/ferese-settings/src/main.rs index be3c40e..6755313 100644 --- a/shell/ferese-settings/src/main.rs +++ b/shell/ferese-settings/src/main.rs @@ -9,7 +9,7 @@ mod panel_inspector; mod panel_preview; mod theme_controls; -use theme_controls::*; +use theme_controls::gallery_id; mod displays; mod displays_ui; @@ -1309,7 +1309,9 @@ mod tests { app.page = Page::Bar; let edit = panel_controls::initialize(&app.draft).unwrap(); app.draft.edit(&edit).unwrap(); - use cosmic::iced::advanced::{layout, renderer::Headless, widget::Tree}; + use cosmic::iced::advanced::layout; + use cosmic::iced::advanced::renderer::Headless; + use cosmic::iced::advanced::widget::Tree; use cosmic::iced::{Font, Pixels, Size}; let runtime = tokio::runtime::Builder::new_current_thread() .enable_all() @@ -1537,7 +1539,9 @@ mod tests { .enable_all() .build() .unwrap(); - use cosmic::iced::advanced::{layout, renderer::Headless, widget::Tree}; + use cosmic::iced::advanced::layout; + use cosmic::iced::advanced::renderer::Headless; + use cosmic::iced::advanced::widget::Tree; use cosmic::iced::{Font, Pixels, Size}; let renderer = runtime .block_on(::new( @@ -1722,9 +1726,8 @@ mod tests { #[ignore = "release scroll/render sample; requires both renderer backends"] fn profile_dense_pages_on_both_renderers() { use cosmic::iced::advanced::renderer::{Headless, Renderer as _}; - use cosmic::iced::advanced::{ - Layout, Shell, clipboard, layout, mouse, renderer, widget::Tree, - }; + use cosmic::iced::advanced::widget::Tree; + use cosmic::iced::advanced::{Layout, Shell, clipboard, layout, mouse, renderer}; use cosmic::iced::{Color, Event, Font, Pixels, Point, Rectangle, Size}; let runtime = tokio::runtime::Builder::new_current_thread() .enable_all() diff --git a/shell/ferese-settings/src/panel_controls.rs b/shell/ferese-settings/src/panel_controls.rs index 41a02c0..a321f16 100644 --- a/shell/ferese-settings/src/panel_controls.rs +++ b/shell/ferese-settings/src/panel_controls.rs @@ -1,7 +1,8 @@ use ferese_panel::{Edge, ItemKind, Panel}; use crate::panel_edit::{Action, Destination, Zone}; -use crate::{App, Element, Message, schema::Page, store, widget}; +use crate::schema::Page; +use crate::{App, Element, Message, store, widget}; #[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] pub(super) enum PanelPage { @@ -1036,7 +1037,8 @@ mod tests { #[test] fn editor_zones_wrap_without_putting_groups_outside_the_available_width() { use cosmic::Application; - use cosmic::iced::advanced::{Layout, layout, renderer::Headless, widget as advanced}; + use cosmic::iced::advanced::renderer::Headless; + use cosmic::iced::advanced::{Layout, layout, widget as advanced}; use cosmic::iced::{Font, Pixels, Rectangle, Size}; struct Bounds { ids: Vec, diff --git a/shell/ferese-settings/src/panel_drag.rs b/shell/ferese-settings/src/panel_drag.rs index 5885a86..b24d515 100644 --- a/shell/ferese-settings/src/panel_drag.rs +++ b/shell/ferese-settings/src/panel_drag.rs @@ -455,7 +455,8 @@ impl Widget for Editor<'_> { mod tests { use super::*; use crate::store::{Snapshot, set}; - use cosmic::iced::advanced::{clipboard, renderer::Headless}; + use cosmic::iced::advanced::clipboard; + use cosmic::iced::advanced::renderer::Headless; use cosmic::iced::{Font, Pixels}; use cosmic::widget::{button, column, container, row, text}; diff --git a/shell/ferese-settings/src/panel_preview.rs b/shell/ferese-settings/src/panel_preview.rs index 1755560..8336e82 100644 --- a/shell/ferese-settings/src/panel_preview.rs +++ b/shell/ferese-settings/src/panel_preview.rs @@ -522,9 +522,8 @@ fn preview_button(palette: visuals::Palette, selected: bool) -> cosmic::theme::B mod tests { use super::*; use cosmic::Application; - use cosmic::iced::advanced::{ - Layout, Shell, clipboard, layout, mouse, renderer::Headless, widget, - }; + use cosmic::iced::advanced::renderer::Headless; + use cosmic::iced::advanced::{Layout, Shell, clipboard, layout, mouse, widget}; use cosmic::iced::{Event, Font, Pixels, Point, Rectangle, Size}; #[test] diff --git a/shell/ferese-settings/src/wallpaper_controls.rs b/shell/ferese-settings/src/wallpaper_controls.rs index 8f531f5..507f4f4 100644 --- a/shell/ferese-settings/src/wallpaper_controls.rs +++ b/shell/ferese-settings/src/wallpaper_controls.rs @@ -488,8 +488,9 @@ mod tests { #[test] fn preview_slots_keep_their_size_while_loading_and_on_failure() { use cosmic::Application; + use cosmic::iced::advanced::layout; use cosmic::iced::advanced::renderer::Headless; - use cosmic::iced::advanced::{layout, widget::Tree}; + use cosmic::iced::advanced::widget::Tree; use cosmic::iced::{Font, Pixels, Size}; let runtime = tokio::runtime::Builder::new_current_thread() @@ -565,7 +566,8 @@ mod tests { fn render_preview_pages_on_both_backends() { use cosmic::Application; use cosmic::iced::advanced::renderer::{Headless, Renderer as _}; - use cosmic::iced::advanced::{Layout, layout, mouse, renderer, widget::Tree}; + use cosmic::iced::advanced::widget::Tree; + use cosmic::iced::advanced::{Layout, layout, mouse, renderer}; use cosmic::iced::{Color, Font, Pixels, Rectangle, Size}; let runtime = tokio::runtime::Builder::new_current_thread() diff --git a/shell/ferese-shell/src/bar.rs b/shell/ferese-shell/src/bar.rs index 47b4647..7cd0b2b 100644 --- a/shell/ferese-shell/src/bar.rs +++ b/shell/ferese-shell/src/bar.rs @@ -968,7 +968,8 @@ mod island_tests { } use crate::panel::{ItemId, Panel}; - use cosmic::iced::advanced::{Layout, layout, renderer::Headless, widget}; + use cosmic::iced::advanced::renderer::Headless; + use cosmic::iced::advanced::{Layout, layout, widget}; use cosmic::iced::{Font, Pixels, Rectangle, Size}; #[derive(Default)] diff --git a/shell/ferese-shell/src/clock.rs b/shell/ferese-shell/src/clock.rs index 56c886c..8da1335 100644 --- a/shell/ferese-shell/src/clock.rs +++ b/shell/ferese-shell/src/clock.rs @@ -6,7 +6,8 @@ use std::os::unix::net::UnixStream; use std::path::{Path, PathBuf}; use cosmic::iced::{Subscription, futures}; -use jiff::{Timestamp, Zoned, tz::TimeZone}; +use jiff::tz::TimeZone; +use jiff::{Timestamp, Zoned}; const SECOND: i128 = 1_000_000_000; const MINUTE: i128 = 60 * SECOND; diff --git a/shell/ferese-shell/src/display_mode.rs b/shell/ferese-shell/src/display_mode.rs index 6b7f69b..ba53a0d 100644 --- a/shell/ferese-shell/src/display_mode.rs +++ b/shell/ferese-shell/src/display_mode.rs @@ -1,4 +1,6 @@ -use super::*; +use super::{ + FereseShell, Instant, Length, Message, Task, button, compositor_ipc, container, row, theme, +}; use serde_json::{Value, json}; #[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] @@ -288,7 +290,8 @@ impl FereseShell { } pub(super) fn display_mode_key(&mut self, key: &cosmic::iced::keyboard::Key) -> Task { - use cosmic::iced::keyboard::{Key, key::Named}; + use cosmic::iced::keyboard::Key; + use cosmic::iced::keyboard::key::Named; let current = Mode::ALL .iter() .position(|mode| *mode == self.display_mode.selected) diff --git a/shell/ferese-shell/src/launcher/mod.rs b/shell/ferese-shell/src/launcher/mod.rs index 3fc1d9e..11f8a0c 100644 --- a/shell/ferese-shell/src/launcher/mod.rs +++ b/shell/ferese-shell/src/launcher/mod.rs @@ -9,8 +9,15 @@ mod thumbnails; mod view; mod work; -use super::*; -use cosmic::iced::keyboard::{Key, key::Named}; +use super::{ + Anchor, Border, Color, ContentFit, Duration, EffectsBinding, Element, Event, FereseShell, + IcedMargin, IcedOutput, Instant, KeyboardInteractivity, Layer, Length, PlatformSpecific, + SctkLayerSurfaceSettings, ShellControl, Subscription, Task, bar_icon, button, + color_with_opacity, container, destroy_layer_surface, ferese_surface_effects_v1, image, motion, + native_wayland_surface, row, system_modal, theme, wayland, window, wl_surface, +}; +use cosmic::iced::keyboard::Key; +use cosmic::iced::keyboard::key::Named; use ferese_animation::{AnimatedValue, SpringConfig}; use sources::{Category, Row, Source, Target}; use std::sync::Arc; diff --git a/shell/ferese-shell/src/launcher/thumbnails.rs b/shell/ferese-shell/src/launcher/thumbnails.rs index a8a9546..9b7826f 100644 --- a/shell/ferese-shell/src/launcher/thumbnails.rs +++ b/shell/ferese-shell/src/launcher/thumbnails.rs @@ -1,4 +1,4 @@ -use super::*; +use super::{Duration, FereseShell, Instant, Row, ShellControl, Target, image}; use std::collections::{HashMap, HashSet}; use std::sync::atomic::{AtomicU32, Ordering}; static NEXT_TOKEN: AtomicU32 = AtomicU32::new(1); diff --git a/shell/ferese-shell/src/launcher/view.rs b/shell/ferese-shell/src/launcher/view.rs index 81bf840..4392d7a 100644 --- a/shell/ferese-shell/src/launcher/view.rs +++ b/shell/ferese-shell/src/launcher/view.rs @@ -1,4 +1,8 @@ -use super::*; +use super::{ + Border, Category, Color, ContentFit, Element, FereseShell, Length, Message, Row, Target, + bar_icon, button, color_with_opacity, container, ferese_surface_effects_v1, image, motion, row, + theme, window, +}; use cosmic::iced::border::Shape; use cosmic::iced::widget::{Space, mouse_area, opaque, rich_text, span, stack}; use cosmic::widget::{column, text_input}; diff --git a/shell/ferese-shell/src/launcher/work.rs b/shell/ferese-shell/src/launcher/work.rs index fe4e6f1..232a7bc 100644 --- a/shell/ferese-shell/src/launcher/work.rs +++ b/shell/ferese-shell/src/launcher/work.rs @@ -1,7 +1,5 @@ -use std::sync::{ - Arc, - atomic::{AtomicBool, Ordering}, -}; +use std::sync::Arc; +use std::sync::atomic::{AtomicBool, Ordering}; #[derive(Clone, Default, Debug)] pub(super) struct Cancellation(Arc); diff --git a/shell/ferese-shell/src/main.rs b/shell/ferese-shell/src/main.rs index a810440..14776bd 100644 --- a/shell/ferese-shell/src/main.rs +++ b/shell/ferese-shell/src/main.rs @@ -3,8 +3,8 @@ mod bar; mod battery_indicator; mod surfaces; -use bar::*; -use surfaces::*; +use bar::{bar_content, output_bar_hidden}; +use surfaces::{EffectsBinding, EffectsContext, native_wayland_surface}; mod clock; mod compositor_ipc; @@ -1335,6 +1335,9 @@ fn color_with_opacity(mut value: [u8; 4], opacity: f32) -> Color { #[cfg(test)] mod tests { use super::*; + use crate::bar::bar_hidden; + use crate::bar::focused_bar_title; + use crate::bar::workspace_active_on_bar; use crate::control::{OutputSnapshot, WindowSnapshot}; pub(super) fn shell_with_measured_panel() -> FereseShell { let config = ShellConfig::default(); diff --git a/shell/ferese-shell/src/motion.rs b/shell/ferese-shell/src/motion.rs index 9b1c9ca..5c48a6a 100644 --- a/shell/ferese-shell/src/motion.rs +++ b/shell/ferese-shell/src/motion.rs @@ -675,7 +675,8 @@ mod tests { #[test] fn motion_preserves_accessible_controls_and_translates_tooltip_overlays() { use super::*; - use cosmic::iced::advanced::{clipboard, renderer::Headless}; + use cosmic::iced::advanced::clipboard; + use cosmic::iced::advanced::renderer::Headless; use cosmic::iced::{Font, Pixels, Point}; let renderer = cosmic::iced::futures::executor::block_on(cosmic::Renderer::new( Font::default(), diff --git a/shell/ferese-shell/src/motion/frames.rs b/shell/ferese-shell/src/motion/frames.rs index 0784892..a351f06 100644 --- a/shell/ferese-shell/src/motion/frames.rs +++ b/shell/ferese-shell/src/motion/frames.rs @@ -1,6 +1,12 @@ //! Surface-local animation sampling. Iced's Wayland backend gates NextFrame //! redraws on that surface's frame callback; no animation timer is needed. -use super::*; +#[cfg(test)] +use crate::motion::Settings; + +use super::{ + Clipboard, Element, Event, Layout, Length, Rectangle, Shell, Size, Theme, Vector, Widget, + layout, mouse, renderer, widget, +}; use std::time::Instant; pub(crate) struct ContentMeasurement<'a, M> { @@ -339,9 +345,12 @@ impl<'a, M: 'a> Widget for FrameDriven<'a, M> { #[cfg(test)] mod tests { use super::*; + use crate::motion::PopupMotion; + use cosmic::iced::advanced::Renderer; use cosmic::iced::advanced::renderer::Headless; use cosmic::iced::window::{Event as WindowEvent, RedrawRequest}; - use std::{cell::RefCell, time::Duration}; + use std::cell::RefCell; + use std::time::Duration; #[test] fn callbacks_sample_every_refresh_without_timers_and_stop_when_settled() { diff --git a/shell/ferese-shell/src/notification_ui.rs b/shell/ferese-shell/src/notification_ui.rs index aacdd99..1e73123 100644 --- a/shell/ferese-shell/src/notification_ui.rs +++ b/shell/ferese-shell/src/notification_ui.rs @@ -2,7 +2,13 @@ use cosmic::iced::border::Shape as BorderShape; use cosmic::iced::widget::scrollable::{Direction, Scrollbar}; use cosmic::widget::{column, scrollable}; -use super::*; +use super::{ + Anchor, Background, Border, Color, Duration, EffectsBinding, Element, FereseShell, IcedOutput, + KeyboardInteractivity, Layer, Length, Limits, Message, SctkLayerSurfaceSettings, Task, + accented_icon, alignment, bar_icon, button, color, color_with_opacity, container, + destroy_layer_surface, ferese_surface_effects_v1, icon, motion, notifications, row, set_size, + status, status_ui, theme, window, wl_output, +}; const POPUP_WIDTH: u32 = 368; const HISTORY_MAX_HEIGHT: f32 = 620.0; @@ -935,7 +941,8 @@ impl FereseShell { mod tests { use super::*; use cosmic::iced::advanced::renderer::{Headless, Renderer as _}; - use cosmic::iced::advanced::{Layout, layout, mouse, widget::Tree}; + use cosmic::iced::advanced::widget::Tree; + use cosmic::iced::advanced::{Layout, layout, mouse}; use cosmic::iced::{Font, Pixels, Rectangle, Size}; #[test] diff --git a/shell/ferese-shell/src/panel_hub.rs b/shell/ferese-shell/src/panel_hub.rs index 799f9c0..803584c 100644 --- a/shell/ferese-shell/src/panel_hub.rs +++ b/shell/ferese-shell/src/panel_hub.rs @@ -1676,7 +1676,8 @@ mod tests { } #[test] fn pomodoro_controls_fit_and_tab_enter_targets_the_current_session() { - use cosmic::iced::advanced::{renderer::Headless, widget::operation}; + use cosmic::iced::advanced::renderer::Headless; + use cosmic::iced::advanced::widget::operation; use cosmic::iced::keyboard::{Event as KeyEvent, Key, Location, Modifiers, key}; use ferese_activities::pomodoro::{Session, Status}; use ferese_ipc::activities::PomodoroAction; @@ -2017,9 +2018,8 @@ mod tests { #[test] fn live_activity_keeps_workspace_wheel_handler() { - use cosmic::iced::advanced::{ - Layout, Shell, clipboard, layout, renderer::Headless, widget, - }; + use cosmic::iced::advanced::renderer::Headless; + use cosmic::iced::advanced::{Layout, Shell, clipboard, layout, widget}; use cosmic::iced::{Event, Size, mouse}; let renderer = cosmic::iced::futures::executor::block_on(cosmic::Renderer::new( cosmic::iced::Font::default(), @@ -2183,9 +2183,11 @@ mod tests { #[test] fn activity_arrows_follow_tab_focus() { + use cosmic::iced::Size; + use cosmic::iced::advanced::renderer::Headless; use cosmic::iced::advanced::widget::operation; - use cosmic::iced::advanced::{Layout, layout, renderer::Headless, widget}; - use cosmic::iced::{Size, keyboard::key::Named}; + use cosmic::iced::advanced::{Layout, layout, widget}; + use cosmic::iced::keyboard::key::Named; let renderer = cosmic::iced::futures::executor::block_on(cosmic::Renderer::new( cosmic::iced::Font::default(), cosmic::iced::Pixels(14.), diff --git a/shell/ferese-shell/src/panel_hub/battery.rs b/shell/ferese-shell/src/panel_hub/battery.rs index 182afb3..7ba5160 100644 --- a/shell/ferese-shell/src/panel_hub/battery.rs +++ b/shell/ferese-shell/src/panel_hub/battery.rs @@ -1,5 +1,5 @@ //! A fixed-width battery silhouette; the percentage is text, not regenerated SVG. -use super::*; +use super::{Element, FereseShell, Message, button, color_with_opacity, motion, status_ui, window}; pub(super) const WIDTH: f64 = 38.; diff --git a/shell/ferese-shell/src/panel_hub/equalizer.rs b/shell/ferese-shell/src/panel_hub/equalizer.rs index 30c1d7a..3daa4d0 100644 --- a/shell/ferese-shell/src/panel_hub/equalizer.rs +++ b/shell/ferese-shell/src/panel_hub/equalizer.rs @@ -121,7 +121,8 @@ impl Widget, Theme, cosmic::Renderer> for Equalizer { #[cfg(test)] mod tests { use super::*; - use cosmic::iced::advanced::{clipboard, renderer::Headless}; + use cosmic::iced::advanced::clipboard; + use cosmic::iced::advanced::renderer::Headless; #[test] fn bars_redraw_without_rebuilding_layout_or_publishing_messages() { diff --git a/shell/ferese-shell/src/panel_hub/workspace_grid.rs b/shell/ferese-shell/src/panel_hub/workspace_grid.rs index af624ee..24d3d38 100644 --- a/shell/ferese-shell/src/panel_hub/workspace_grid.rs +++ b/shell/ferese-shell/src/panel_hub/workspace_grid.rs @@ -3,7 +3,8 @@ mod thumbnail; use cosmic::app::Task; use cosmic::iced::advanced::widget::{Id, operation}; -use cosmic::iced::{Alignment, Length, keyboard::key::Named, window}; +use cosmic::iced::keyboard::key::Named; +use cosmic::iced::{Alignment, Length, window}; use cosmic::widget::{button, column, container, mouse_area, row, scrollable}; use cosmic::{Element, theme}; @@ -559,7 +560,8 @@ mod tests { #[test] fn arrows_follow_the_tile_focused_by_tab_in_both_directions_and_narrow_grids() { use cosmic::iced::Size; - use cosmic::iced::advanced::{Layout, layout, renderer::Headless, widget}; + use cosmic::iced::advanced::renderer::Headless; + use cosmic::iced::advanced::{Layout, layout, widget}; let renderer = cosmic::iced::futures::executor::block_on(cosmic::Renderer::new( cosmic::iced::Font::default(), cosmic::iced::Pixels(14.), diff --git a/shell/ferese-shell/src/panel_hub/workspace_grid/drag.rs b/shell/ferese-shell/src/panel_hub/workspace_grid/drag.rs index 1d1e5a7..ba42fb5 100644 --- a/shell/ferese-shell/src/panel_hub/workspace_grid/drag.rs +++ b/shell/ferese-shell/src/panel_hub/workspace_grid/drag.rs @@ -217,7 +217,8 @@ impl Widget for DragArea<'_> { #[cfg(test)] mod tests { use super::*; - use cosmic::iced::advanced::{clipboard, renderer::Headless}; + use cosmic::iced::advanced::clipboard; + use cosmic::iced::advanced::renderer::Headless; #[test] fn drag_moves_the_pressed_window_once_and_click_still_selects_workspace() { diff --git a/shell/ferese-shell/src/panel_hub/workspaces.rs b/shell/ferese-shell/src/panel_hub/workspaces.rs index 7c5a3dd..664438e 100644 --- a/shell/ferese-shell/src/panel_hub/workspaces.rs +++ b/shell/ferese-shell/src/panel_hub/workspaces.rs @@ -1,10 +1,12 @@ use std::time::{Duration, Instant}; use cosmic::app::Task; -use cosmic::iced::{Alignment, mouse::ScrollDelta, window}; +use cosmic::iced::mouse::ScrollDelta; +use cosmic::iced::{Alignment, window}; use cosmic::widget::{button, container, row}; use cosmic::{Element, theme}; -use ferese_panel::{ItemKind, morph::Mode}; +use ferese_panel::ItemKind; +use ferese_panel::morph::Mode; use super::Event; use crate::control::WorkspaceSnapshot; diff --git a/shell/ferese-shell/src/panel_runtime.rs b/shell/ferese-shell/src/panel_runtime.rs index 0e96a7b..d1e4cc9 100644 --- a/shell/ferese-shell/src/panel_runtime.rs +++ b/shell/ferese-shell/src/panel_runtime.rs @@ -8,7 +8,8 @@ use cosmic::iced::window; use ferese_panel::adaptive::{Adaptive, WindowState}; use ferese_panel::{Panel, PanelStyle}; -use crate::{FereseShell, Message, control::ShellSnapshot, output_bar_hidden}; +use crate::control::ShellSnapshot; +use crate::{FereseShell, Message, output_bar_hidden}; pub(super) struct Runtime { pub(super) hub: Option>, diff --git a/shell/ferese-shell/src/status_ui/lifecycle.rs b/shell/ferese-shell/src/status_ui/lifecycle.rs index 6ea8256..ef758b4 100644 --- a/shell/ferese-shell/src/status_ui/lifecycle.rs +++ b/shell/ferese-shell/src/status_ui/lifecycle.rs @@ -1,9 +1,8 @@ use std::time::Instant; use cosmic::app::Task; -use cosmic::iced::Rectangle; use cosmic::iced::platform_specific::runtime::wayland::popup::{SctkPopupSettings, SctkPositioner}; -use cosmic::iced::{Limits, window}; +use cosmic::iced::{Limits, Rectangle, window}; use wayland_client::Proxy; use super::{Menu, OpenMenu, PopoverAnchor}; diff --git a/shell/ferese-shell/src/status_ui/mod.rs b/shell/ferese-shell/src/status_ui/mod.rs index 122acf7..c35152f 100644 --- a/shell/ferese-shell/src/status_ui/mod.rs +++ b/shell/ferese-shell/src/status_ui/mod.rs @@ -17,7 +17,11 @@ use cosmic::iced::border::Shape as BorderShape; use cosmic::widget::column; use status::{Action, Snapshot}; -use super::*; +use super::{ + Background, Border, Color, EffectsBinding, EffectsContext, Element, FereseShell, Instant, + Length, Limits, Message, Ordering, ShellTheme, accented_icon, color, color_with_opacity, + container, motion, row, status, theme, window, wl_surface, +}; type MenuHeading<'a> = cosmic::widget::Row<'a, cosmic::Action, cosmic::Theme, cosmic::Renderer>; @@ -570,12 +574,12 @@ fn notification_controls<'a>( #[cfg(test)] mod tests { use super::*; + use std::time::Duration; #[test] fn activity_popups_scroll_to_the_last_row_in_regular_panels() { - use cosmic::iced::advanced::{ - Layout, Shell, clipboard, layout, renderer::Headless, widget, - }; + use cosmic::iced::advanced::renderer::Headless; + use cosmic::iced::advanced::{Layout, Shell, clipboard, layout, widget}; use cosmic::iced::{Event, Rectangle, Size, Vector, mouse}; use ferese_activities::{Data, Owner, Source, Store, Template, Value}; #[derive(Default)] diff --git a/shell/ferese-shell/src/status_ui/night_light.rs b/shell/ferese-shell/src/status_ui/night_light.rs index 17c30c4..eeeb8b9 100644 --- a/shell/ferese-shell/src/status_ui/night_light.rs +++ b/shell/ferese-shell/src/status_ui/night_light.rs @@ -1,6 +1,6 @@ use cosmic::widget::{column, slider}; -use super::*; +use super::{Action, FereseShell, MenuRows, MenuStyle, Message, control_card, toggle_row}; pub(super) fn view<'a>( shell: &'a FereseShell, diff --git a/shell/ferese-shell/src/system_modal.rs b/shell/ferese-shell/src/system_modal.rs index c0135b5..7d57f78 100644 --- a/shell/ferese-shell/src/system_modal.rs +++ b/shell/ferese-shell/src/system_modal.rs @@ -2,7 +2,12 @@ use cosmic::iced::border::Shape as BorderShape; use cosmic::iced::widget::Space; use cosmic::widget::column; -use super::*; +use super::{ + Anchor, Background, Border, Color, EffectsBinding, Element, FereseShell, IcedOutput, Instant, + KeyboardInteractivity, Layer, Length, Message, SctkLayerSurfaceSettings, Task, button, + color_with_opacity, compositor_ipc, container, destroy_layer_surface, + ferese_surface_effects_v1, keybinding_guide, motion, row, status, theme, window, wl_surface, +}; #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub(super) enum PowerAction { @@ -765,6 +770,7 @@ fn modal_focus_operation( #[cfg(test)] mod tests { use super::*; + use cosmic::iced::Event; #[test] fn a_cancelled_modal_that_opens_late_is_destroyed_without_closing_its_replacement() {