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

+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> {