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 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;
+4 -7
View File
@@ -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,
+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_ipc::activities::{PomodoroAction, PomodoroRequest};
+4 -5
View File
@@ -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<Response>);
struct Job {
+2 -4
View File
@@ -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<AtomicBool>);
+1 -1
View File
@@ -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};
+4 -1
View File
@@ -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 {
+9 -1
View File
@@ -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};
+3 -1
View File
@@ -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);
+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;
pub(super) fn monotonic_now() -> Duration {
@@ -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<S: Session> {
session: S,
@@ -37,7 +41,10 @@ impl<S: Session> Drop for SessionDevice<S> {
#[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<Cell<Option<i32>>>);
+7 -1
View File
@@ -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<Node = DrmNode> {
+11 -2
View File
@@ -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<D: ControlDevice, H: ResourceHandle>(
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::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() {
+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 {
pub(crate) fn focus_effect_settings(&self) -> Result<FocusEffectSettings, ConfigError> {
+4 -1
View File
@@ -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;
+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.
/// 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 {
+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)]
#[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 {
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 {
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 {
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)]
#[serde(default, deny_unknown_fields)]
+2 -1
View File
@@ -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;
+2 -2
View File
@@ -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,
+3 -1
View File
@@ -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::<Ferese, ZwlrGammaControlManagerV1, ()>(1, ());
+6 -8
View File
@@ -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;
+2 -1
View File
@@ -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;
+2 -4
View File
@@ -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};
+2 -1
View File
@@ -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;
+4 -3
View File
@@ -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;
+2 -1
View File
@@ -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(
+4 -1
View File
@@ -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;
+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)]
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 {
+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)]
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_core::OutputId;
use ferese_layout::WindowId;
+1 -1
View File
@@ -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()
})
+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(
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
+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)]
pub(super) fn append_material_surface(
+23 -13
View File
@@ -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]
+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)]
pub(super) fn overview_chrome_element(
+23 -1
View File
@@ -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() {
+19 -1
View File
@@ -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() {
+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};
#[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(
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)]
pub(super) struct WindowBlur {
+32 -1
View File
@@ -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"]
+2 -3
View File
@@ -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;
-3
View File
@@ -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);
+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 {
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);
@@ -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
+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 {
pub(super) fn adjust_floating_direction(
+2 -1
View File
@@ -1,4 +1,4 @@
use super::*;
use super::{Ferese, OutputId, WindowId, WindowPlacement};
impl Ferese {
pub(super) fn focus_candidates(&self) -> Vec<WindowId> {
@@ -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;
+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 {
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)]
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};
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 {
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 {
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::{
@@ -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;
+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
/// 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() {
@@ -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<Item = (WindowId, Rect, Rect)>,
+28 -1
View File
@@ -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 {
+6 -5
View File
@@ -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 {
+3 -1
View File
@@ -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) {
+14 -1
View File
@@ -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);
@@ -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
+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 {
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 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};
+1 -2
View File
@@ -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;
+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)]
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_json::{Value, json};
+2 -1
View File
@@ -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 {
+2 -1
View File
@@ -276,7 +276,8 @@ impl<M> Widget<M, Theme, cosmic::Renderer> 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;
+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::{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};
+3 -3
View File
@@ -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]
+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 std::{error::Error, path::Path};
use std::error::Error;
use std::path::Path;
fn prepare(source: &str) -> Result<String, Box<dyn Error>> {
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.
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};
+4 -1
View File
@@ -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 {
+9 -6
View File
@@ -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(<cosmic::Renderer as Headless>::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()
+4 -2
View File
@@ -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<advanced::Id>,
+2 -1
View File
@@ -455,7 +455,8 @@ impl Widget<Message, Theme, Renderer> 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};
+2 -3
View File
@@ -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]
@@ -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()
+2 -1
View File
@@ -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)]
+2 -1
View File
@@ -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;
+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};
#[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> {
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)
+9 -2
View File
@@ -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;
@@ -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);
+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::widget::{Space, mouse_area, opaque, rich_text, span, stack};
use cosmic::widget::{column, text_input};
+2 -4
View File
@@ -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<AtomicBool>);
+5 -2
View File
@@ -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();
+2 -1
View File
@@ -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(),
+11 -2
View File
@@ -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<M, Theme, cosmic::Renderer> 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() {
+9 -2
View File
@@ -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]
+8 -6
View File
@@ -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.),
+1 -1
View File
@@ -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.;
@@ -121,7 +121,8 @@ impl Widget<cosmic::Action<Message>, 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() {
@@ -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.),
@@ -217,7 +217,8 @@ impl Widget<Action, Theme, cosmic::Renderer> 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() {
@@ -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;
+2 -1
View File
@@ -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<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