Make module dependencies explicit across the workspace

This commit is contained in:
Samuel Onoja committed 2026-10-22 01:28:03 +01:00
1 parent 610478f8c7
commit 1b4db0e681
104 files changed
+614 -203

No files matched your search

+2 -4
View File
@@ -4,10 +4,8 @@ pub(crate) mod deadline;
mod pomodoro; mod pomodoro;
mod publication; mod publication;
use ferese_activities::{Data, Id, Owner, Source, State, Store, Template, Value}; use ferese_activities::{Data, Id, Owner, Source, State, Store, Template, Value};
use ferese_ipc::{ use ferese_ipc::Response;
Response, use ferese_ipc::activities::{Publish, Snapshot};
activities::{Publish, Snapshot},
};
use serde_json::json; use serde_json::json;
use std::collections::BTreeMap; use std::collections::BTreeMap;
use std::sync::mpsc::SyncSender; use std::sync::mpsc::SyncSender;
+4 -7
View File
@@ -1,12 +1,9 @@
//! Activity deadlines share CLOCK_BOOTTIME with the published countdowns. A //! Activity deadlines share CLOCK_BOOTTIME with the published countdowns. A
//! monotonic calloop timer would otherwise keep waiting for time spent asleep. //! monotonic calloop timer would otherwise keep waiting for time spent asleep.
use smithay::reexports::calloop::{ use smithay::reexports::calloop::generic::Generic;
Interest, LoopHandle, Mode, PostAction, RegistrationToken, generic::Generic, use smithay::reexports::calloop::{Interest, LoopHandle, Mode, PostAction, RegistrationToken};
}; use std::io;
use std::{ use std::os::fd::{AsRawFd, FromRawFd, OwnedFd};
io,
os::fd::{AsRawFd, FromRawFd, OwnedFd},
};
pub(crate) struct Deadline { pub(crate) struct Deadline {
fd: OwnedFd, fd: OwnedFd,
+4 -1
View File
@@ -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_activities::pomodoro::{Session, Status};
use ferese_ipc::activities::{PomodoroAction, PomodoroRequest}; use ferese_ipc::activities::{PomodoroAction, PomodoroRequest};
+4 -5
View File
@@ -1,9 +1,8 @@
//! Bounded serialization and delivery outside the compositor event loop. //! Bounded serialization and delivery outside the compositor event loop.
use ferese_ipc::{Response, activities::Snapshot}; use ferese_ipc::Response;
use std::sync::{ use ferese_ipc::activities::Snapshot;
Arc, RwLock, use std::sync::mpsc::{self, SyncSender};
mpsc::{self, SyncSender}, use std::sync::{Arc, RwLock};
};
type Recipient = (u64, SyncSender<Response>); type Recipient = (u64, SyncSender<Response>);
struct Job { struct Job {
+2 -4
View File
@@ -5,10 +5,8 @@ use ferese_activities::Owner;
use smithay::reexports::calloop::channel; use smithay::reexports::calloop::channel;
use std::collections::BTreeMap; use std::collections::BTreeMap;
use std::io::Read; use std::io::Read;
use std::sync::{ use std::sync::Arc;
Arc, use std::sync::atomic::{AtomicBool, Ordering};
atomic::{AtomicBool, Ordering},
};
use std::time::Duration; use std::time::Duration;
pub(crate) struct Watcher(Arc<AtomicBool>); pub(crate) struct Watcher(Arc<AtomicBool>);
+1 -1
View File
@@ -23,7 +23,7 @@ mod transaction;
use diagnostics::{Diagnostics, PrimaryOutcome}; use diagnostics::{Diagnostics, PrimaryOutcome};
use output_power::{OutputPower, Power}; use output_power::{OutputPower, Power};
use redraw::{AnimationFallback, SchedulingMetrics}; 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::gbm::{GbmAllocator, GbmBufferFlags, GbmDevice};
use smithay::backend::allocator::{Buffer, Fourcc}; use smithay::backend::allocator::{Buffer, Fourcc};
use smithay::backend::drm::compositor::{DrmCompositor, FrameFlags, PrimaryPlaneElement}; use smithay::backend::drm::compositor::{DrmCompositor, FrameFlags, PrimaryPlaneElement};
+4 -1
View File
@@ -1,7 +1,10 @@
//! Resume reads are asynchronous; newer switch events win over old replies. //! Resume reads are asynchronous; newer switch events win over old replies.
use std::sync::{Arc, Mutex, mpsc}; 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)] #[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub(super) struct Probe { pub(super) struct Probe {
+9 -1
View File
@@ -1,6 +1,14 @@
//! A target displays a composition of the source, with no second workspace or input domain. //! 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. //! 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::backend::renderer::Texture;
use smithay::utils::{Buffer, Physical, Rectangle}; use smithay::utils::{Buffer, Physical, Rectangle};
+3 -1
View File
@@ -1,5 +1,7 @@
//! Uncertain KMS completion requires device reconciliation, not buffer reuse. //! 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); const COMPLETION_TIMEOUT: Duration = Duration::from_secs(2);
+4 -1
View File
@@ -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; use crate::frame_scheduler::FramePlan;
pub(super) fn monotonic_now() -> Duration { pub(super) fn monotonic_now() -> Duration {
@@ -1,5 +1,9 @@
use smithay::{backend::session::Session, reexports::rustix::fs::OFlags, utils::DeviceFd}; use smithay::backend::session::Session;
use std::{io, os::fd::OwnedFd, path::Path}; 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<S: Session> { pub(super) struct SessionDevice<S: Session> {
session: S, session: S,
@@ -37,7 +41,10 @@ impl<S: Session> Drop for SessionDevice<S> {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; 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)] #[derive(Clone, Default)]
struct TestSession(Rc<Cell<Option<i32>>>); struct TestSession(Rc<Cell<Option<i32>>>);
+7 -1
View File
@@ -1,7 +1,13 @@
//! Desired device identities survive temporary loss of their DRM resources. //! Desired device identities survive temporary loss of their DRM resources.
use std::path::PathBuf; 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)] #[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub(super) enum Availability<Node = DrmNode> { pub(super) enum Availability<Node = DrmNode> {
+11 -2
View File
@@ -1,10 +1,19 @@
//! Validate a device-wide desired topology, then use Smithay for every real commit. //! 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 //! 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. //! 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::allocator::Allocator;
use smithay::backend::drm::exporter::{ExportBuffer, ExportFramebuffer}; 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<D: ControlDevice, H: ResourceHandle>( fn property<D: ControlDevice, H: ResourceHandle>(
drm: &D, drm: &D,
+9 -6
View File
@@ -14,18 +14,17 @@ use std::path::PathBuf;
pub(crate) use self::loading::{prepare, prepare_document, read_source, startup}; pub(crate) use self::loading::{prepare, prepare_document, read_source, startup};
pub(crate) use self::xwayland::{XwaylandConfig, XwaylandStartup}; pub(crate) use self::xwayland::{XwaylandConfig, XwaylandStartup};
use appearance::*; use appearance::{AppearanceConfig, ThemeConfig, parse_color};
pub use appearance::{BorderGradient, FocusEffectSettings, MaterialStyle, ThemeSettings}; pub use appearance::{BorderGradient, FocusEffectSettings, MaterialStyle, ThemeSettings};
pub(crate) use bindings::BindingModes;
use bindings::*;
pub use bindings::{Binding, BindingAction}; 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_animation::SpringConfig;
use ferese_core::LayoutMode; use ferese_core::LayoutMode;
use ferese_layout::{ColumnWidth, Direction, GapConfig, ViewportFocusStrategy}; use ferese_layout::{ColumnWidth, Direction, GapConfig, ViewportFocusStrategy};
pub use input_motion::InputSettings; pub use input_motion::InputSettings;
use input_motion::*; use input_motion::{AnimationsConfig, InputConfig};
use outputs::*; use outputs::OutputProfileConfig;
pub use outputs::{ pub use outputs::{
LidPolicy, OutputLayout, OutputModeRequest, OutputProfile, OutputSettings, OutputTransform, LidPolicy, OutputLayout, OutputModeRequest, OutputProfile, OutputSettings, OutputTransform,
}; };
@@ -567,6 +566,10 @@ mod tests {
} }
use super::*; 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] #[test]
fn display_key_has_a_default_binding_and_can_be_rebound() { fn display_key_has_a_default_binding_and_can_be_rebound() {
+4 -1
View File
@@ -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 { impl Config {
pub(crate) fn focus_effect_settings(&self) -> Result<FocusEffectSettings, ConfigError> { pub(crate) fn focus_effect_settings(&self) -> Result<FocusEffectSettings, ConfigError> {
+4 -1
View File
@@ -1,6 +1,9 @@
use std::sync::Arc; use std::sync::Arc;
use super::*; use super::{
BindingIdentity, Config, ConfigError, Deserialize, Direction, HashMap, HashSet, InputSettings,
Keycode, keysyms, xkb,
};
mod index; mod index;
mod modes; mod modes;
+14 -1
View File
@@ -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. /// Immutable bindings and their keyboard index are replaced together on reload.
/// The ordered slice remains available for gestures and the shortcut guide. /// The ordered slice remains available for gestures and the shortcut guide.
@@ -87,6 +97,9 @@ impl BindingSet {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use crate::config::Config;
use crate::config::bindings::BindingTrigger;
use std::sync::Arc;
fn binding_for(trigger: BindingTrigger, action: BindingAction) -> Binding { fn binding_for(trigger: BindingTrigger, action: BindingAction) -> Binding {
Binding { Binding {
+7 -1
View File
@@ -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)] #[derive(Debug, Deserialize)]
#[serde(deny_unknown_fields)] #[serde(deny_unknown_fields)]
+4 -1
View File
@@ -1,4 +1,7 @@
use super::*; use super::{
Config, ConfigError, Deserialize, SpringConfig, default_repeat_delay, default_repeat_rate,
enabled_by_default,
};
impl Config { impl Config {
pub fn input_settings(&self) -> Result<InputSettings, ConfigError> { pub fn input_settings(&self) -> Result<InputSettings, ConfigError> {
+4 -1
View File
@@ -1,4 +1,7 @@
use super::*; use super::{
ColumnDisplayValue, ColumnWidth, ColumnWidthValue, Config, ConfigError, FocusStrategyValue,
GapConfig, LayoutMode, LayoutModeValue, ViewportFocusStrategy,
};
impl Config { impl Config {
pub fn default_column_display(&self) -> ferese_layout::ColumnDisplay { pub fn default_column_display(&self) -> ferese_layout::ColumnDisplay {
+1 -1
View File
@@ -1,4 +1,4 @@
use super::*; use super::{Config, ConfigError, Deserialize, HashSet, default_true};
impl Config { impl Config {
pub fn output_profiles(&self) -> Result<Vec<OutputProfile>, ConfigError> { pub fn output_profiles(&self) -> Result<Vec<OutputProfile>, ConfigError> {
+1 -1
View File
@@ -1,4 +1,4 @@
use super::*; use super::{Config, ConfigError, Deserialize, parse_color};
#[derive(Clone, Debug, Deserialize)] #[derive(Clone, Debug, Deserialize)]
#[serde(default, deny_unknown_fields)] #[serde(default, deny_unknown_fields)]
+2 -1
View File
@@ -2,7 +2,8 @@ use std::collections::VecDeque;
use std::time::{Duration, Instant}; use std::time::{Duration, Instant};
use smithay::input::Seat; 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::utils::Serial;
use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface; use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface;
+2 -2
View File
@@ -1,7 +1,7 @@
use crate::Ferese; use crate::Ferese;
use smithay::reexports::wayland_server::backend::ClientId;
use smithay::reexports::wayland_server::{ use smithay::reexports::wayland_server::{
Client, DataInit, Dispatch, DisplayHandle, GlobalDispatch, New, Resource, backend::ClientId, Client, DataInit, Dispatch, DisplayHandle, GlobalDispatch, New, Resource, protocol as wl,
protocol as wl,
}; };
use smithay::reexports::{ use smithay::reexports::{
wayland_protocols as protocols, wayland_protocols_misc as misc, wayland_protocols_wlr as wlr, wayland_protocols as protocols, wayland_protocols_misc as misc, wayland_protocols_wlr as wlr,
+3 -1
View File
@@ -9,7 +9,9 @@ use smithay::reexports::wayland_server::{
Client, DataInit, Dispatch, DisplayHandle, GlobalDispatch, New, Resource, 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) { pub(crate) fn init_global(display: &DisplayHandle) {
display.create_global::<Ferese, ZwlrGammaControlManagerV1, ()>(1, ()); display.create_global::<Ferese, ZwlrGammaControlManagerV1, ()>(1, ());
+6 -8
View File
@@ -1,11 +1,9 @@
//! Converts output-buffer readback into upright image coordinates. //! Converts output-buffer readback into upright image coordinates.
use std::path::{Path, PathBuf}; 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::mpsc::SyncSender as ReplySender;
use std::sync::{
Arc,
atomic::{AtomicUsize, Ordering},
};
use std::time::{Duration, Instant}; use std::time::{Duration, Instant};
use ferese_ipc::Response; use ferese_ipc::Response;
@@ -1954,10 +1952,10 @@ mod tests {
fn conversion_does_not_flip_vertically() { fn conversion_does_not_flip_vertically() {
// Top row red, bottom row blue. An extra Y flip would swap them. // Top row red, bottom row blue. An extra Y flip would swap them.
let mut f = frame(Transform::Normal, 1, 2); 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(); let out = scale_and_convert(&f, 1, 2).unwrap();
assert_eq!(&out[0..4], &[0xFF, 0x00, 0x00, 255], "top row"); 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[4..8], &[0x00, 0x00, 0xff, 255], "bottom row");
} }
#[test] #[test]
@@ -1971,7 +1969,7 @@ mod tests {
let value = (row * 2 + column) as u8; let value = (row * 2 + column) as u8;
padded.extend_from_slice(&[value, value, value, 255]); padded.extend_from_slice(&[value, value, value, 255]);
} }
padded.extend_from_slice(&[0xEE; 4]); padded.extend_from_slice(&[0xee; 4]);
} }
f.pixels = padded; f.pixels = padded;
+2 -1
View File
@@ -7,7 +7,8 @@ use std::time::Instant;
use calloop::EventLoop; use calloop::EventLoop;
use calloop::channel::{Event, sync_channel}; 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 serde_json::Value;
use crate::Ferese; use crate::Ferese;
+2 -4
View File
@@ -2,10 +2,8 @@ use std::collections::HashMap;
use std::time::Duration; use std::time::Duration;
use calloop::channel::SyncSender; use calloop::channel::SyncSender;
use ferese_ipc::{ use ferese_ipc::Response;
Response, use ferese_ipc::media::{Playback, now_us};
media::{Playback, now_us},
};
use futures_lite::{StreamExt, future, stream}; use futures_lite::{StreamExt, future, stream};
use zbus::zvariant::{Array, OwnedObjectPath, OwnedValue, Value}; use zbus::zvariant::{Array, OwnedObjectPath, OwnedValue, Value};
use zbus::{Connection, MatchRule, MessageStream}; use zbus::{Connection, MatchRule, MessageStream};
+2 -1
View File
@@ -2,7 +2,8 @@ use super::*;
use smithay::backend::input::UnusedEvent; use smithay::backend::input::UnusedEvent;
use smithay::backend::winit::WinitVirtualDevice; use smithay::backend::winit::WinitVirtualDevice;
use smithay::input::keyboard::Keycode; 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)] #[derive(Debug)]
struct TestInput; struct TestInput;
+4 -3
View File
@@ -1,13 +1,14 @@
use super::*; use super::*;
use crate::state::ClientState;
use crate::state::{ 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::desktop::{LayerSurface, layer_map_for_output};
use smithay::output::{Mode, Output, PhysicalProperties, Subpixel}; use smithay::output::{Mode, Output, PhysicalProperties, Subpixel};
use smithay::reexports::calloop::EventLoop; use smithay::reexports::calloop::EventLoop;
use smithay::reexports::wayland_protocols_wlr::layer_shell::v1::server::zwlr_layer_shell_v1::ZwlrLayerShellV1; 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::io::{Read, Write};
use std::os::fd::AsRawFd; use std::os::fd::AsRawFd;
use std::os::unix::net::UnixStream; use std::os::unix::net::UnixStream;
+2 -1
View File
@@ -254,7 +254,8 @@ mod tests {
fn topology_events_wait_for_publication_and_report_config_commits() { fn topology_events_wait_for_publication_and_report_config_commits() {
use crate::state::DesktopOutput; use crate::state::DesktopOutput;
use smithay::output::{Mode, Output, PhysicalProperties, Scale, Subpixel}; 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; use smithay::utils::Transform;
if !crate::startup_tests::private_runtime( if !crate::startup_tests::private_runtime(
+4 -1
View File
@@ -1,6 +1,9 @@
//! Supervise the explicitly opted-in desktop helper. Each generation gets new //! Supervise the explicitly opted-in desktop helper. Each generation gets new
//! private Wayland connections; a dead generation's descriptors are never reused. //! 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 calloop::RegistrationToken;
use std::ffi::OsString; use std::ffi::OsString;
use std::time::Instant; use std::time::Instant;
+10 -1
View File
@@ -1,4 +1,7 @@
use super::*; use super::{
AnimatedWindowRenderElement, Buffer, CommitCounter, Element, Id, Ordering, Physical, Rectangle,
RenderScale, Transform,
};
#[derive(Clone, Debug, Default)] #[derive(Clone, Debug, Default)]
pub(super) struct Backdrop { pub(super) struct Backdrop {
@@ -132,6 +135,12 @@ pub(super) fn update(elements: &[AnimatedWindowRenderElement], scale: f64) {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
#[cfg(test)]
use smithay::backend::renderer::utils::DamageSet;
#[cfg(test)]
use smithay::backend::renderer::utils::OpaqueRegions;
use std::sync::Arc;
use super::*; use super::*;
struct TestElement { struct TestElement {
+7 -1
View File
@@ -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)] #[derive(Default)]
struct CaptureTarget(std::sync::Mutex<Option<GlesTexture>>); struct CaptureTarget(std::sync::Mutex<Option<GlesTexture>>);
+5 -1
View File
@@ -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_animation::{CrossingPolicy, SpringConfig};
use ferese_core::OutputId; use ferese_core::OutputId;
use ferese_layout::WindowId; use ferese_layout::WindowId;
+1 -1
View File
@@ -207,7 +207,7 @@ fn window_corner_shader_timing_sample() {
let mut renderer = renderer(); let mut renderer = renderer();
let driver = renderer let driver = renderer
.with_context(|gl| { .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() .to_string_lossy()
.into_owned() .into_owned()
}) })
+11 -4
View File
@@ -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( pub(super) fn rounded_clip_program(
resources: &mut RenderResources, 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] { pub(super) fn color_with_alpha(mut color: [f32; 4], alpha: f32) -> [f32; 4] {
color[3] *= alpha; color[3] *= alpha;
color color
+12 -1
View File
@@ -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)] #[allow(clippy::too_many_arguments)]
pub(super) fn append_material_surface( pub(super) fn append_material_surface(
+23 -13
View File
@@ -22,9 +22,18 @@ use std::time::Duration;
pub(crate) use capture::{ pub(crate) use capture::{
capture_resize_snapshot, capture_window_buffer, capture_window_frame, convert_window_pixels, capture_resize_snapshot, capture_window_buffer, capture_window_frame, convert_window_pixels,
}; };
use decorations::*; use decorations::{
use materials::*; border_uniforms, color_with_alpha, corner_program, framebuffer_clip_rect,
use overview::*; 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; pub(crate) use resources::RenderResources;
use scene::cursor_elements; use scene::cursor_elements;
pub(crate) use scene::{ pub(crate) use scene::{
@@ -654,14 +663,18 @@ where
#[cfg(test)] #[cfg(test)]
mod tests { 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::damage::OutputDamageTracker;
use smithay::backend::renderer::element::{Element, Id}; use smithay::backend::renderer::element::{Element, Id};
use smithay::backend::renderer::utils::CommitCounter; use smithay::backend::renderer::utils::CommitCounter;
use smithay::utils::{Buffer, Logical, Physical, Rectangle, Scale, Transform}; use smithay::utils::{Buffer, Logical, Physical, Rectangle, Scale, Transform};
use super::{ use super::{
border_gradient_line, color_with_alpha, framebuffer_clip_rect, resize_content_behavior, color_with_alpha, framebuffer_clip_rect, resize_content_behavior, rounded_visual_rect,
rounded_visual_rect, scaled_visual_rect, shadow_bounds, shadow_bounds,
}; };
#[test] #[test]
@@ -782,7 +795,7 @@ mod tests {
let program = renderer let program = renderer
.compile_custom_texture_shader( .compile_custom_texture_shader(
super::corner_shader(super::BLUR_SHADER), super::corner_shader(super::BLUR_SHADER),
&super::blur_uniform_names(), &blur_uniform_names(),
) )
.unwrap(); .unwrap();
let size = (32, 32).into(); let size = (32, 32).into();
@@ -1184,21 +1197,18 @@ mod tests {
fn translucent_materials_blur_at_full_opacity() { fn translucent_materials_blur_at_full_opacity() {
use crate::config::MaterialStyle; use crate::config::MaterialStyle;
assert_eq!( assert_eq!(
super::material_blur_radius(MaterialStyle::Translucent, 0.0, 18.0), material_blur_radius(MaterialStyle::Translucent, 0.0, 18.0),
0.0 0.0
); );
assert_eq!( assert_eq!(
super::material_blur_radius(MaterialStyle::Translucent, 1.0, 18.0), material_blur_radius(MaterialStyle::Translucent, 1.0, 18.0),
18.0 18.0
); );
assert_eq!( assert_eq!(
super::material_blur_radius(MaterialStyle::Translucent, 0.79, 18.0), material_blur_radius(MaterialStyle::Translucent, 0.79, 18.0),
18.0 18.0
); );
assert_eq!( assert_eq!(material_blur_radius(MaterialStyle::Solid, 0.79, 18.0), 0.0);
super::material_blur_radius(MaterialStyle::Solid, 0.79, 18.0),
0.0
);
} }
#[test] #[test]
+9 -1
View File
@@ -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)] #[allow(clippy::too_many_arguments)]
pub(super) fn overview_chrome_element( pub(super) fn overview_chrome_element(
+23 -1
View File
@@ -1,8 +1,25 @@
use ferese_core::OutputId; 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 ferese_layout::WindowId;
use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface; 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 /// Resource ownership follows the lifetime of a window, output, surface or GL
/// context. Desktop policy and animation values do not live in these caches. /// context. Desktop policy and animation values do not live in these caches.
@@ -208,6 +225,11 @@ impl RenderResources {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; 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] #[test]
fn window_removal_releases_all_its_caches_without_removing_other_windows() { fn window_removal_releases_all_its_caches_without_removing_other_windows() {
+19 -1
View File
@@ -1,6 +1,23 @@
use smithay::desktop::Window; 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( pub(crate) fn animated_window_elements(
state: &mut Ferese, state: &mut Ferese,
@@ -602,6 +619,7 @@ pub(super) fn cursor_elements(
#[cfg(test)] #[cfg(test)]
mod layer_crop_tests { mod layer_crop_tests {
use super::*; use super::*;
use smithay::backend::renderer::element::Element;
#[test] #[test]
fn layer_crop_keeps_bottom_edge_content_in_every_output_transform() { fn layer_crop_keeps_bottom_edge_content_in_every_output_transform() {
+6 -1
View File
@@ -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}; use ferese_layout::{Rect, TabBar, WindowId};
#[allow(clippy::too_many_arguments)] #[allow(clippy::too_many_arguments)]
+6 -1
View File
@@ -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( pub(super) fn tab_elements(
state: &mut Ferese, state: &mut Ferese,
+5 -1
View File
@@ -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)] #[derive(Debug)]
pub(super) struct WindowBlur { pub(super) struct WindowBlur {
+32 -1
View File
@@ -1,5 +1,27 @@
//! Live, overview and retained views use the same snapshot mapping and clip. //! 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( pub(super) fn snapshot_element(
snapshot: &ResizeSnapshot, snapshot: &ResizeSnapshot,
@@ -60,6 +82,15 @@ pub(super) fn snapshot_element(
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; 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] #[test]
#[ignore = "requires an EGL rendering device"] #[ignore = "requires an EGL rendering device"]
+2 -3
View File
@@ -10,9 +10,8 @@ use calloop::EventLoop;
use calloop::signals::{Signal, Signals}; use calloop::signals::{Signal, Signals};
use smithay::input::SeatHandler; use smithay::input::SeatHandler;
use smithay::input::pointer::{CursorImageStatus, MotionEvent}; use smithay::input::pointer::{CursorImageStatus, MotionEvent};
use smithay::reexports::wayland_server::protocol::{ use smithay::reexports::wayland_server::protocol::wl_compositor::WlCompositor;
wl_compositor::WlCompositor, wl_surface::WlSurface, use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface;
};
use smithay::reexports::wayland_server::{Display, Resource}; use smithay::reexports::wayland_server::{Display, Resource};
use smithay::utils::SERIAL_COUNTER; use smithay::utils::SERIAL_COUNTER;
-3
View File
@@ -119,9 +119,6 @@ use crate::wallpaper::{WallpaperConfig, WallpaperState};
use crate::window_rules::{WindowRule, resolve as resolve_window_rules}; use crate::window_rules::{WindowRule, resolve as resolve_window_rules};
use crate::winit::NestedBackend; use crate::winit::NestedBackend;
#[cfg(test)]
use ferese_animation::CrossingPolicy;
#[cfg(test)] #[cfg(test)]
const SLIDE_SETTLE_TEST_BUDGET: Duration = Duration::from_secs(2); const SLIDE_SETTLE_TEST_BUDGET: Duration = Duration::from_secs(2);
+21 -1
View File
@@ -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 { impl Ferese {
pub(super) fn presentation_now(&self) -> Duration { pub(super) fn presentation_now(&self) -> Duration {
@@ -740,8 +746,22 @@ fn record_needs_tick(
#[cfg(test)] #[cfg(test)]
mod tests { 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::super::window_registry::WindowRecord;
use super::*; use super::*;
use smithay::output::Output;
use smithay::reexports::wayland_server::Display;
fn settled() -> WindowRecord { fn settled() -> WindowRecord {
let rect = Rect::new(0.0, 0.0, 400.0, 300.0); let rect = Rect::new(0.0, 0.0, 400.0, 300.0);
@@ -13,7 +13,8 @@ use smithay::desktop::Window;
use smithay::output::{Mode, Output, PhysicalProperties, Scale, Subpixel}; use smithay::output::{Mode, Output, PhysicalProperties, Scale, Subpixel};
use smithay::reexports::calloop::EventLoop; use smithay::reexports::calloop::EventLoop;
use smithay::reexports::wayland_protocols::xdg::shell::server::xdg_wm_base::XdgWmBase; 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::reexports::wayland_server::{Display, Resource};
use smithay::utils::{Rectangle, Transform}; use smithay::utils::{Rectangle, Transform};
use smithay::wayland::compositor::with_states; 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 // 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. // 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; use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface;
let client = secret.toplevel().unwrap().wl_surface().client().unwrap(); let client = secret.toplevel().unwrap().wl_surface().client().unwrap();
let compositor = client let compositor = client
+6 -1
View File
@@ -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 { impl Ferese {
pub(super) fn adjust_floating_direction( pub(super) fn adjust_floating_direction(
+2 -1
View File
@@ -1,4 +1,4 @@
use super::*; use super::{Ferese, OutputId, WindowId, WindowPlacement};
impl Ferese { impl Ferese {
pub(super) fn focus_candidates(&self) -> Vec<WindowId> { pub(super) fn focus_candidates(&self) -> Vec<WindowId> {
@@ -142,6 +142,7 @@ impl Ferese {
mod tests { mod tests {
use super::*; use super::*;
use crate::state::capture_privacy::tests::window; use crate::state::capture_privacy::tests::window;
use smithay::output::Output;
use smithay::reexports::calloop::EventLoop; use smithay::reexports::calloop::EventLoop;
use std::os::unix::net::UnixStream; use std::os::unix::net::UnixStream;
+5 -1
View File
@@ -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 { impl Ferese {
pub fn surface_under( pub fn surface_under(
+7 -1
View File
@@ -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)] #[derive(Default)]
pub(super) struct PreviewCache { pub(super) struct PreviewCache {
+1 -1
View File
@@ -1,4 +1,4 @@
use super::*; use super::{ClientSize, Ferese, Instant, Window, WlSurface, with_states};
use smithay::wayland::compositor::{BufferAssignment, SurfaceAttributes}; use smithay::wayland::compositor::{BufferAssignment, SurfaceAttributes};
impl Ferese { impl Ferese {
+5 -1
View File
@@ -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 { impl Ferese {
pub fn focus_direction(&mut self, direction: Direction) { pub fn focus_direction(&mut self, direction: Direction) {
+13 -1
View File
@@ -1,4 +1,4 @@
use super::*; use super::{DesktopOutput, Ferese, Logical, Output, OutputId, Point};
impl Ferese { impl Ferese {
pub(crate) fn defer_output_redraw(&mut self, output: Output) { pub(crate) fn defer_output_redraw(&mut self, output: Output) {
@@ -191,6 +191,18 @@ impl Ferese {
#[cfg(test)] #[cfg(test)]
mod tests { 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 super::*;
use smithay::backend::input::{ use smithay::backend::input::{
@@ -1,4 +1,6 @@
use super::*; use super::*;
use crate::state::ClientState;
use crate::state::DesktopOutput;
use smithay::output::{Mode, PhysicalProperties, Scale, Subpixel}; use smithay::output::{Mode, PhysicalProperties, Scale, Subpixel};
use smithay::reexports::calloop::EventLoop; use smithay::reexports::calloop::EventLoop;
use smithay::reexports::wayland_protocols_wlr::layer_shell::v1::server::zwlr_layer_shell_v1::ZwlrLayerShellV1; use smithay::reexports::wayland_protocols_wlr::layer_shell::v1::server::zwlr_layer_shell_v1::ZwlrLayerShellV1;
+17 -1
View File
@@ -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 /// Output-local presentation values. Sampling never changes authoritative
/// geometry, configure barriers, animation clocks, or another output's view. /// geometry, configure barriers, animation clocks, or another output's view.
@@ -457,7 +460,20 @@ fn predict_geometry(
#[cfg(test)] #[cfg(test)]
mod tests { 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 super::*;
use crate::state::WorkspaceSlide;
use smithay::reexports::wayland_server::Display;
use std::time::Instant;
#[test] #[test]
fn pending_resize_waits_without_refresh_cadence_and_recovers() { fn pending_resize_waits_without_refresh_cadence_and_recovers() {
@@ -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; use smithay::utils::Serial;
#[derive(Clone, Copy, Debug, PartialEq)] #[derive(Clone, Copy, Debug, PartialEq)]
@@ -518,6 +533,8 @@ impl Ferese {
mod tests { mod tests {
use super::*; use super::*;
use crate::resize_transaction::ResizeTransaction; use crate::resize_transaction::ResizeTransaction;
use crate::state::ViewportPresentation;
use std::time::Duration;
fn tree_reflow_groups( fn tree_reflow_groups(
motions: impl IntoIterator<Item = (WindowId, Rect, Rect)>, motions: impl IntoIterator<Item = (WindowId, Rect, Rect)>,
+28 -1
View File
@@ -1,5 +1,25 @@
//! Exceptional topology publication. Ordinary input/damage never constructs a plan. //! 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::output::{Mode, Scale};
use smithay::utils::Transform; use smithay::utils::Transform;
@@ -237,10 +257,17 @@ impl Ferese {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; 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::output::{PhysicalProperties, Subpixel};
use smithay::reexports::wayland_server::Display;
use smithay::reexports::wayland_server::Resource; use smithay::reexports::wayland_server::Resource;
use std::io::{Read, Write}; use std::io::{Read, Write};
use std::os::unix::net::UnixStream; use std::os::unix::net::UnixStream;
use std::sync::Arc;
use std::time::Duration;
fn output(name: &str, x: i32, width: i32) -> DesktopOutput { fn output(name: &str, x: i32, width: i32) -> DesktopOutput {
DesktopOutput { DesktopOutput {
+6 -5
View File
@@ -1,9 +1,10 @@
use super::*; use super::{
use crate::config::TabIndicatorSettings; AnimatedValue, Duration, Ferese, Instant, Layer, Logical, Output, Point, Rect, SpringConfig,
use smithay::reexports::calloop::{ WindowId, WorkspaceLayout,
RegistrationToken,
timer::{TimeoutAction, Timer},
}; };
use crate::config::TabIndicatorSettings;
use smithay::reexports::calloop::RegistrationToken;
use smithay::reexports::calloop::timer::{TimeoutAction, Timer};
#[derive(Debug)] #[derive(Debug)]
pub(crate) struct Overlay { pub(crate) struct Overlay {
+3 -1
View File
@@ -1,4 +1,6 @@
use super::*; use super::{
Direction, Ferese, Layer, Logical, Point, Rect, WindowId, WorkspaceId, WorkspaceLayout,
};
impl Ferese { impl Ferese {
pub(crate) fn join_tab(&mut self, direction: Direction) { pub(crate) fn join_tab(&mut self, direction: Direction) {
+14 -1
View File
@@ -1,4 +1,4 @@
use super::*; use super::{AnimatedValue, Duration, Ferese, FocusSwipe, SpringConfig};
#[derive(Clone, PartialEq)] #[derive(Clone, PartialEq)]
enum ViewportOwner { enum ViewportOwner {
@@ -223,7 +223,20 @@ impl Ferese {
#[cfg(test)] #[cfg(test)]
mod tests { 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 super::*;
use crate::state::restored_scrolling_world_x;
const TICK: Duration = Duration::from_millis(16); const TICK: Duration = Duration::from_millis(16);
@@ -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>) { fn change_transient_parent(state: &mut Ferese, child: &Window, parent: Option<&Window>) {
use smithay::wayland::{ use smithay::wayland::compositor::with_states;
compositor::with_states, use smithay::wayland::shell::xdg::{XdgShellHandler, XdgToplevelSurfaceData};
shell::xdg::{XdgShellHandler, XdgToplevelSurfaceData},
};
let toplevel = child.toplevel().unwrap(); let toplevel = child.toplevel().unwrap();
with_states(toplevel.wl_surface(), |states| { with_states(toplevel.wl_surface(), |states| {
states states
+6 -1
View File
@@ -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 { impl Ferese {
pub(crate) fn window_for_surface(&self, surface: &WlSurface) -> Option<Window> { pub(crate) fn window_for_surface(&self, surface: &WlSurface) -> Option<Window> {
+2 -4
View File
@@ -10,10 +10,8 @@ use calloop::timer::{TimeoutAction, Timer};
use calloop::{Interest, Mode as PollMode, PostAction}; use calloop::{Interest, Mode as PollMode, PostAction};
use ferese_config::Document; use ferese_config::Document;
use ferese_config::theme::{Candidate, Mode, TRANSITION_MS, resolve_with_context}; use ferese_config::theme::{Candidate, Mode, TRANSITION_MS, resolve_with_context};
use ferese_ipc::{ use ferese_ipc::Response;
Response, use ferese_ipc::theme::{SCHEMA_VERSION, Snapshot};
theme::{SCHEMA_VERSION, Snapshot},
};
use jiff::Timestamp; use jiff::Timestamp;
use notify::{RecommendedWatcher, RecursiveMode, Watcher}; use notify::{RecommendedWatcher, RecursiveMode, Watcher};
use serde_json::{Value, json}; use serde_json::{Value, json};
+1 -2
View File
@@ -681,11 +681,10 @@ fn live_dependencies() -> PathBuf {
mod manager_loop { mod manager_loop {
use super::*; use super::*;
use crate::Ferese;
use crate::config::{XwaylandConfig, XwaylandStartup}; use crate::config::{XwaylandConfig, XwaylandStartup};
use crate::xwayland;
use crate::xwayland::lifecycle::Phase; use crate::xwayland::lifecycle::Phase;
use crate::xwayland::test_hooks; use crate::xwayland::test_hooks;
use crate::{Ferese, xwayland};
use ferese_ipc::xwayland::{Readiness, State}; use ferese_ipc::xwayland::{Readiness, State};
use smithay::reexports::calloop::EventLoop; use smithay::reexports::calloop::EventLoop;
use smithay::reexports::wayland_server::Display; use smithay::reexports::wayland_server::Display;
+2 -1
View File
@@ -1,4 +1,5 @@
use std::{collections::VecDeque, time::Duration}; use std::collections::VecDeque;
use std::time::Duration;
#[derive(Default, Debug)] #[derive(Default, Debug)]
pub struct VelocityTracker { pub struct VelocityTracker {
+2 -1
View File
@@ -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::{Deserialize, Serialize};
use serde_json::{Value, json}; use serde_json::{Value, json};
+2 -1
View File
@@ -1,5 +1,6 @@
use cosmic::iced::border::Shape as BorderShape; 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)] #[derive(Clone, Copy, Debug, PartialEq)]
pub struct Palette { pub struct Palette {
+2 -1
View File
@@ -276,7 +276,8 @@ impl<M> Widget<M, Theme, cosmic::Renderer> for Adaptive<'_, M> {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; 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::iced::{Font, Pixels, Point};
use cosmic::widget::{button, text}; use cosmic::widget::{button, text};
use ferese_panel::OverflowPolicy; use ferese_panel::OverflowPolicy;
+3 -2
View File
@@ -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::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::iced::{Color, Event, Length, Point, Rectangle, Size, Vector};
use cosmic::{Element, Theme}; use cosmic::{Element, Theme};
use ferese_panel::scene::{GroupBounds, Parameters, Scene}; use ferese_panel::scene::{GroupBounds, Parameters, Scene};
+3 -3
View File
@@ -237,9 +237,9 @@ pub fn sample<'a, M: 'a>(
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use cosmic::iced::advanced::{ use cosmic::iced::advanced::renderer::Headless;
Layout, Renderer, layout, renderer, renderer::Headless, widget::Tree, use cosmic::iced::advanced::widget::Tree;
}; use cosmic::iced::advanced::{Layout, Renderer, layout, renderer};
use cosmic::iced::{Font, Pixels, Rectangle, Size, mouse}; use cosmic::iced::{Font, Pixels, Rectangle, Size, mouse};
#[test] #[test]
+4 -2
View File
@@ -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 serde_json::json;
use std::{error::Error, path::Path}; use std::error::Error;
use std::path::Path;
fn prepare(source: &str) -> Result<String, Box<dyn Error>> { fn prepare(source: &str) -> Result<String, Box<dyn Error>> {
let mut doc = Document::parse(source)?; let mut doc = Document::parse(source)?;
+2 -1
View File
@@ -1,7 +1,8 @@
//! A complete exchange has one deadline, including a full Unix listen backlog. //! A complete exchange has one deadline, including a full Unix listen backlog.
use std::io::{self, Read, Write}; use std::io::{self, Read, Write};
use std::os::fd::{AsRawFd, FromRawFd}; 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::path::Path;
use std::time::{Duration, Instant}; use std::time::{Duration, Instant};
+4 -1
View File
@@ -1,6 +1,9 @@
use clap::Subcommand; use clap::Subcommand;
use ferese_ipc::activities::{PomodoroAction, PomodoroRequest, VERSION}; 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)] #[derive(Debug, Subcommand)]
pub enum Action { pub enum Action {
+9 -6
View File
@@ -9,7 +9,7 @@ mod panel_inspector;
mod panel_preview; mod panel_preview;
mod theme_controls; mod theme_controls;
use theme_controls::*; use theme_controls::gallery_id;
mod displays; mod displays;
mod displays_ui; mod displays_ui;
@@ -1309,7 +1309,9 @@ mod tests {
app.page = Page::Bar; app.page = Page::Bar;
let edit = panel_controls::initialize(&app.draft).unwrap(); let edit = panel_controls::initialize(&app.draft).unwrap();
app.draft.edit(&edit).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}; use cosmic::iced::{Font, Pixels, Size};
let runtime = tokio::runtime::Builder::new_current_thread() let runtime = tokio::runtime::Builder::new_current_thread()
.enable_all() .enable_all()
@@ -1537,7 +1539,9 @@ mod tests {
.enable_all() .enable_all()
.build() .build()
.unwrap(); .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}; use cosmic::iced::{Font, Pixels, Size};
let renderer = runtime let renderer = runtime
.block_on(<cosmic::Renderer as Headless>::new( .block_on(<cosmic::Renderer as Headless>::new(
@@ -1722,9 +1726,8 @@ mod tests {
#[ignore = "release scroll/render sample; requires both renderer backends"] #[ignore = "release scroll/render sample; requires both renderer backends"]
fn profile_dense_pages_on_both_renderers() { fn profile_dense_pages_on_both_renderers() {
use cosmic::iced::advanced::renderer::{Headless, Renderer as _}; use cosmic::iced::advanced::renderer::{Headless, Renderer as _};
use cosmic::iced::advanced::{ use cosmic::iced::advanced::widget::Tree;
Layout, Shell, clipboard, layout, mouse, renderer, widget::Tree, use cosmic::iced::advanced::{Layout, Shell, clipboard, layout, mouse, renderer};
};
use cosmic::iced::{Color, Event, Font, Pixels, Point, Rectangle, Size}; use cosmic::iced::{Color, Event, Font, Pixels, Point, Rectangle, Size};
let runtime = tokio::runtime::Builder::new_current_thread() let runtime = tokio::runtime::Builder::new_current_thread()
.enable_all() .enable_all()
+4 -2
View File
@@ -1,7 +1,8 @@
use ferese_panel::{Edge, ItemKind, Panel}; use ferese_panel::{Edge, ItemKind, Panel};
use crate::panel_edit::{Action, Destination, Zone}; 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)] #[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
pub(super) enum PanelPage { pub(super) enum PanelPage {
@@ -1036,7 +1037,8 @@ mod tests {
#[test] #[test]
fn editor_zones_wrap_without_putting_groups_outside_the_available_width() { fn editor_zones_wrap_without_putting_groups_outside_the_available_width() {
use cosmic::Application; 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}; use cosmic::iced::{Font, Pixels, Rectangle, Size};
struct Bounds { struct Bounds {
ids: Vec<advanced::Id>, ids: Vec<advanced::Id>,
+2 -1
View File
@@ -455,7 +455,8 @@ impl Widget<Message, Theme, Renderer> for Editor<'_> {
mod tests { mod tests {
use super::*; use super::*;
use crate::store::{Snapshot, set}; 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::iced::{Font, Pixels};
use cosmic::widget::{button, column, container, row, text}; use cosmic::widget::{button, column, container, row, text};
+2 -3
View File
@@ -522,9 +522,8 @@ fn preview_button(palette: visuals::Palette, selected: bool) -> cosmic::theme::B
mod tests { mod tests {
use super::*; use super::*;
use cosmic::Application; use cosmic::Application;
use cosmic::iced::advanced::{ use cosmic::iced::advanced::renderer::Headless;
Layout, Shell, clipboard, layout, mouse, renderer::Headless, widget, use cosmic::iced::advanced::{Layout, Shell, clipboard, layout, mouse, widget};
};
use cosmic::iced::{Event, Font, Pixels, Point, Rectangle, Size}; use cosmic::iced::{Event, Font, Pixels, Point, Rectangle, Size};
#[test] #[test]
@@ -488,8 +488,9 @@ mod tests {
#[test] #[test]
fn preview_slots_keep_their_size_while_loading_and_on_failure() { fn preview_slots_keep_their_size_while_loading_and_on_failure() {
use cosmic::Application; use cosmic::Application;
use cosmic::iced::advanced::layout;
use cosmic::iced::advanced::renderer::Headless; 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}; use cosmic::iced::{Font, Pixels, Size};
let runtime = tokio::runtime::Builder::new_current_thread() let runtime = tokio::runtime::Builder::new_current_thread()
@@ -565,7 +566,8 @@ mod tests {
fn render_preview_pages_on_both_backends() { fn render_preview_pages_on_both_backends() {
use cosmic::Application; use cosmic::Application;
use cosmic::iced::advanced::renderer::{Headless, Renderer as _}; 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}; use cosmic::iced::{Color, Font, Pixels, Rectangle, Size};
let runtime = tokio::runtime::Builder::new_current_thread() let runtime = tokio::runtime::Builder::new_current_thread()
+2 -1
View File
@@ -968,7 +968,8 @@ mod island_tests {
} }
use crate::panel::{ItemId, Panel}; 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}; use cosmic::iced::{Font, Pixels, Rectangle, Size};
#[derive(Default)] #[derive(Default)]
+2 -1
View File
@@ -6,7 +6,8 @@ use std::os::unix::net::UnixStream;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use cosmic::iced::{Subscription, futures}; 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 SECOND: i128 = 1_000_000_000;
const MINUTE: i128 = 60 * SECOND; const MINUTE: i128 = 60 * SECOND;
+5 -2
View File
@@ -1,4 +1,6 @@
use super::*; use super::{
FereseShell, Instant, Length, Message, Task, button, compositor_ipc, container, row, theme,
};
use serde_json::{Value, json}; use serde_json::{Value, json};
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] #[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<Message> { pub(super) fn display_mode_key(&mut self, key: &cosmic::iced::keyboard::Key) -> Task<Message> {
use cosmic::iced::keyboard::{Key, key::Named}; use cosmic::iced::keyboard::Key;
use cosmic::iced::keyboard::key::Named;
let current = Mode::ALL let current = Mode::ALL
.iter() .iter()
.position(|mode| *mode == self.display_mode.selected) .position(|mode| *mode == self.display_mode.selected)
+9 -2
View File
@@ -9,8 +9,15 @@ mod thumbnails;
mod view; mod view;
mod work; mod work;
use super::*; use super::{
use cosmic::iced::keyboard::{Key, key::Named}; 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 ferese_animation::{AnimatedValue, SpringConfig};
use sources::{Category, Row, Source, Target}; use sources::{Category, Row, Source, Target};
use std::sync::Arc; use std::sync::Arc;
@@ -1,4 +1,4 @@
use super::*; use super::{Duration, FereseShell, Instant, Row, ShellControl, Target, image};
use std::collections::{HashMap, HashSet}; use std::collections::{HashMap, HashSet};
use std::sync::atomic::{AtomicU32, Ordering}; use std::sync::atomic::{AtomicU32, Ordering};
static NEXT_TOKEN: AtomicU32 = AtomicU32::new(1); static NEXT_TOKEN: AtomicU32 = AtomicU32::new(1);
+5 -1
View File
@@ -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::border::Shape;
use cosmic::iced::widget::{Space, mouse_area, opaque, rich_text, span, stack}; use cosmic::iced::widget::{Space, mouse_area, opaque, rich_text, span, stack};
use cosmic::widget::{column, text_input}; use cosmic::widget::{column, text_input};
+2 -4
View File
@@ -1,7 +1,5 @@
use std::sync::{ use std::sync::Arc;
Arc, use std::sync::atomic::{AtomicBool, Ordering};
atomic::{AtomicBool, Ordering},
};
#[derive(Clone, Default, Debug)] #[derive(Clone, Default, Debug)]
pub(super) struct Cancellation(Arc<AtomicBool>); pub(super) struct Cancellation(Arc<AtomicBool>);
+5 -2
View File
@@ -3,8 +3,8 @@ mod bar;
mod battery_indicator; mod battery_indicator;
mod surfaces; mod surfaces;
use bar::*; use bar::{bar_content, output_bar_hidden};
use surfaces::*; use surfaces::{EffectsBinding, EffectsContext, native_wayland_surface};
mod clock; mod clock;
mod compositor_ipc; mod compositor_ipc;
@@ -1335,6 +1335,9 @@ fn color_with_opacity(mut value: [u8; 4], opacity: f32) -> Color {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; 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}; use crate::control::{OutputSnapshot, WindowSnapshot};
pub(super) fn shell_with_measured_panel() -> FereseShell { pub(super) fn shell_with_measured_panel() -> FereseShell {
let config = ShellConfig::default(); let config = ShellConfig::default();
+2 -1
View File
@@ -675,7 +675,8 @@ mod tests {
#[test] #[test]
fn motion_preserves_accessible_controls_and_translates_tooltip_overlays() { fn motion_preserves_accessible_controls_and_translates_tooltip_overlays() {
use super::*; 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::iced::{Font, Pixels, Point};
let renderer = cosmic::iced::futures::executor::block_on(cosmic::Renderer::new( let renderer = cosmic::iced::futures::executor::block_on(cosmic::Renderer::new(
Font::default(), Font::default(),
+11 -2
View File
@@ -1,6 +1,12 @@
//! Surface-local animation sampling. Iced's Wayland backend gates NextFrame //! Surface-local animation sampling. Iced's Wayland backend gates NextFrame
//! redraws on that surface's frame callback; no animation timer is needed. //! 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; use std::time::Instant;
pub(crate) struct ContentMeasurement<'a, M> { pub(crate) struct ContentMeasurement<'a, M> {
@@ -339,9 +345,12 @@ impl<'a, M: 'a> Widget<M, Theme, cosmic::Renderer> for FrameDriven<'a, M> {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use crate::motion::PopupMotion;
use cosmic::iced::advanced::Renderer;
use cosmic::iced::advanced::renderer::Headless; use cosmic::iced::advanced::renderer::Headless;
use cosmic::iced::window::{Event as WindowEvent, RedrawRequest}; use cosmic::iced::window::{Event as WindowEvent, RedrawRequest};
use std::{cell::RefCell, time::Duration}; use std::cell::RefCell;
use std::time::Duration;
#[test] #[test]
fn callbacks_sample_every_refresh_without_timers_and_stop_when_settled() { fn callbacks_sample_every_refresh_without_timers_and_stop_when_settled() {
+9 -2
View File
@@ -2,7 +2,13 @@ use cosmic::iced::border::Shape as BorderShape;
use cosmic::iced::widget::scrollable::{Direction, Scrollbar}; use cosmic::iced::widget::scrollable::{Direction, Scrollbar};
use cosmic::widget::{column, scrollable}; 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 POPUP_WIDTH: u32 = 368;
const HISTORY_MAX_HEIGHT: f32 = 620.0; const HISTORY_MAX_HEIGHT: f32 = 620.0;
@@ -935,7 +941,8 @@ impl FereseShell {
mod tests { mod tests {
use super::*; use super::*;
use cosmic::iced::advanced::renderer::{Headless, Renderer as _}; 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}; use cosmic::iced::{Font, Pixels, Rectangle, Size};
#[test] #[test]
+8 -6
View File
@@ -1676,7 +1676,8 @@ mod tests {
} }
#[test] #[test]
fn pomodoro_controls_fit_and_tab_enter_targets_the_current_session() { 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 cosmic::iced::keyboard::{Event as KeyEvent, Key, Location, Modifiers, key};
use ferese_activities::pomodoro::{Session, Status}; use ferese_activities::pomodoro::{Session, Status};
use ferese_ipc::activities::PomodoroAction; use ferese_ipc::activities::PomodoroAction;
@@ -2017,9 +2018,8 @@ mod tests {
#[test] #[test]
fn live_activity_keeps_workspace_wheel_handler() { fn live_activity_keeps_workspace_wheel_handler() {
use cosmic::iced::advanced::{ use cosmic::iced::advanced::renderer::Headless;
Layout, Shell, clipboard, layout, renderer::Headless, widget, use cosmic::iced::advanced::{Layout, Shell, clipboard, layout, widget};
};
use cosmic::iced::{Event, Size, mouse}; use cosmic::iced::{Event, Size, mouse};
let renderer = cosmic::iced::futures::executor::block_on(cosmic::Renderer::new( let renderer = cosmic::iced::futures::executor::block_on(cosmic::Renderer::new(
cosmic::iced::Font::default(), cosmic::iced::Font::default(),
@@ -2183,9 +2183,11 @@ mod tests {
#[test] #[test]
fn activity_arrows_follow_tab_focus() { 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::widget::operation;
use cosmic::iced::advanced::{Layout, layout, renderer::Headless, widget}; use cosmic::iced::advanced::{Layout, layout, widget};
use cosmic::iced::{Size, keyboard::key::Named}; use cosmic::iced::keyboard::key::Named;
let renderer = cosmic::iced::futures::executor::block_on(cosmic::Renderer::new( let renderer = cosmic::iced::futures::executor::block_on(cosmic::Renderer::new(
cosmic::iced::Font::default(), cosmic::iced::Font::default(),
cosmic::iced::Pixels(14.), cosmic::iced::Pixels(14.),
+1 -1
View File
@@ -1,5 +1,5 @@
//! A fixed-width battery silhouette; the percentage is text, not regenerated SVG. //! 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.; pub(super) const WIDTH: f64 = 38.;
@@ -121,7 +121,8 @@ impl Widget<cosmic::Action<Message>, Theme, cosmic::Renderer> for Equalizer {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use cosmic::iced::advanced::{clipboard, renderer::Headless}; use cosmic::iced::advanced::clipboard;
use cosmic::iced::advanced::renderer::Headless;
#[test] #[test]
fn bars_redraw_without_rebuilding_layout_or_publishing_messages() { fn bars_redraw_without_rebuilding_layout_or_publishing_messages() {
@@ -3,7 +3,8 @@ mod thumbnail;
use cosmic::app::Task; use cosmic::app::Task;
use cosmic::iced::advanced::widget::{Id, operation}; 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::widget::{button, column, container, mouse_area, row, scrollable};
use cosmic::{Element, theme}; use cosmic::{Element, theme};
@@ -559,7 +560,8 @@ mod tests {
#[test] #[test]
fn arrows_follow_the_tile_focused_by_tab_in_both_directions_and_narrow_grids() { fn arrows_follow_the_tile_focused_by_tab_in_both_directions_and_narrow_grids() {
use cosmic::iced::Size; 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( let renderer = cosmic::iced::futures::executor::block_on(cosmic::Renderer::new(
cosmic::iced::Font::default(), cosmic::iced::Font::default(),
cosmic::iced::Pixels(14.), cosmic::iced::Pixels(14.),
@@ -217,7 +217,8 @@ impl Widget<Action, Theme, cosmic::Renderer> for DragArea<'_> {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use cosmic::iced::advanced::{clipboard, renderer::Headless}; use cosmic::iced::advanced::clipboard;
use cosmic::iced::advanced::renderer::Headless;
#[test] #[test]
fn drag_moves_the_pressed_window_once_and_click_still_selects_workspace() { fn drag_moves_the_pressed_window_once_and_click_still_selects_workspace() {
@@ -1,10 +1,12 @@
use std::time::{Duration, Instant}; use std::time::{Duration, Instant};
use cosmic::app::Task; 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::widget::{button, container, row};
use cosmic::{Element, theme}; use cosmic::{Element, theme};
use ferese_panel::{ItemKind, morph::Mode}; use ferese_panel::ItemKind;
use ferese_panel::morph::Mode;
use super::Event; use super::Event;
use crate::control::WorkspaceSnapshot; use crate::control::WorkspaceSnapshot;
+2 -1
View File
@@ -8,7 +8,8 @@ use cosmic::iced::window;
use ferese_panel::adaptive::{Adaptive, WindowState}; use ferese_panel::adaptive::{Adaptive, WindowState};
use ferese_panel::{Panel, PanelStyle}; 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) struct Runtime {
pub(super) hub: Option<std::cell::RefCell<crate::panel_hub::Runtime>>, pub(super) hub: Option<std::cell::RefCell<crate::panel_hub::Runtime>>,
Loaded 100 of 104 files, more files were not shown because too many files have changed in this diff. Show more