From 68b661a4ec1f5b0193158f699dc31a0c0170da17 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sat, 31 Oct 2026 12:06:17 -0700 Subject: [PATCH] refactor(kde): WorkspaceGlobals is komorebi-core's komorebi-for-kde's workspace.rs re-exports komorebi_core::WorkspaceGlobals instead of defining it (crate::workspace::WorkspaceGlobals keeps working for monitor.rs and the tests). Same fields, same derives. No behaviour change. Verified: KDE cargo test -p komorebi --lib --tests (native, lite env): 630 passed, 0 failed. Not run: doc tests, VM suites. --- komorebi-for-kde/Cargo.lock | 2 ++ komorebi-for-kde/komorebi/src/workspace.rs | 18 +----------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/komorebi-for-kde/Cargo.lock b/komorebi-for-kde/Cargo.lock index 18989dc1..d24c02cb 100644 --- a/komorebi-for-kde/Cargo.lock +++ b/komorebi-for-kde/Cargo.lock @@ -2577,6 +2577,8 @@ name = "komorebi-core" version = "0.1.42" dependencies = [ "komorebi-collections", + "komorebi-config", + "komorebi-layouts", "nanoid", "schemars 1.2.3", "serde", diff --git a/komorebi-for-kde/komorebi/src/workspace.rs b/komorebi-for-kde/komorebi/src/workspace.rs index 2f083acc..d089e02d 100644 --- a/komorebi-for-kde/komorebi/src/workspace.rs +++ b/komorebi-for-kde/komorebi/src/workspace.rs @@ -42,6 +42,7 @@ use color_eyre::eyre; use color_eyre::eyre::OptionExt; use komorebi_backend::MonitorId; use komorebi_backend::WindowId; +pub use komorebi_core::WorkspaceGlobals; use komorebi_scrolling::ScrollingSpace; use komorebi_themes::KomorebiTheme; use komorebi_themes::KomorebiThemeCustom; @@ -218,23 +219,6 @@ pub enum WorkspaceWindowLocation { Floating(usize), // idx in floating_windows } -#[derive(Debug, Default, Copy, Clone, Serialize, Deserialize, PartialEq)] -/// The work area a monitor gives the workspace it shows, the padding and the offset the -/// workspace falls back to when it sets none of its own, the monitor's window-based offset, and -/// the room around each window that a border drawn by the compositor takes -pub struct WorkspaceGlobals { - pub container_padding: Option, - pub workspace_padding: Option, - pub border_width: i32, - pub border_offset: i32, - pub work_area: Rect, - pub work_area_offset: Option, - pub window_based_work_area_offset: Option, - pub window_based_work_area_offset_limit: isize, - /// The floating layer behaviour of the monitor, which the workspace's own overrides - pub floating_layer_behaviour: Option, -} - #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] /// Cached per-layout default options (pre-sorted rules) derived from the global `layout_defaults`. pub(crate) struct CachedLayoutDefault {