refactor(kde): use the behaviour enums of komorebi-config

core re-exports WindowContainerBehaviour, FloatingLayerBehaviour, Placement, CrossBoundaryBehaviour and WindowHidingPosition from komorebi-config; the local definitions and impls are removed, so no call site changes.

Verified: KDE cargo check --workspace --all-targets clean; cargo test -p komorebi --lib: 289 passed, 0 failed; --test schemas: 5 passed; komorebic static-config-schema and application-specific-configuration-schema regenerated: schema.json and schema.asc.json unchanged (byte-identical, no diff).
This commit is contained in:
LGUG2Z committed 2026-10-31 01:37:54 -07:00
1 parent 92adaf72fa
commit 5dc1fe0b4c
1 file changed
+5 -92
+5 -92
View File
@@ -45,6 +45,11 @@ pub use komorebi_layouts::validate_ratios;
pub mod animation;
pub mod asc;
pub mod config_generation;
pub use komorebi_config::behaviour::CrossBoundaryBehaviour;
pub use komorebi_config::behaviour::FloatingLayerBehaviour;
pub use komorebi_config::behaviour::Placement;
pub use komorebi_config::behaviour::WindowContainerBehaviour;
pub use komorebi_config::behaviour::WindowHidingPosition;
pub use komorebi_protocol::pathext;
pub use komorebi_protocol::types::ApplicationIdentifier;
pub use komorebi_protocol::types::FocusFollowsMouseImplementation;
@@ -80,85 +85,6 @@ pub struct WindowManagementBehaviour {
pub float_rule_placement: Placement,
}
#[derive(
Clone, Copy, Debug, Default, Serialize, Deserialize, Display, EnumString, ValueEnum, PartialEq,
)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Window container behaviour when a new window is opened
pub enum WindowContainerBehaviour {
/// Create a new container for each new window
#[default]
Create,
/// Append new windows to the focused window container
Append,
}
#[derive(
Clone, Copy, Debug, Default, Serialize, Deserialize, Display, EnumString, ValueEnum, PartialEq,
)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Floating layer behaviour when a new window is opened
pub enum FloatingLayerBehaviour {
/// Tile new windows (unless they match a float rule or float override is active)
#[default]
Tile,
/// Float new windows
Float,
}
#[derive(
Clone, Copy, Debug, Default, Serialize, Deserialize, Display, EnumString, ValueEnum, PartialEq,
)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Window hiding position
pub enum WindowHidingPosition {
/// Hide windows in the bottom left corner of the screen
#[default]
BottomLeft,
/// Hide windows in the bottom right corner of the screen
BottomRight,
}
#[derive(
Clone, Copy, Debug, Default, Serialize, Deserialize, Display, EnumString, ValueEnum, PartialEq,
)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Placement behaviour for floating windows
pub enum Placement {
/// Does not change the size or position of the window
#[default]
None,
/// Center the window without changing the size
Center,
/// Center the window and resize it according to the `AspectRatio`
CenterAndResize,
}
impl FloatingLayerBehaviour {
pub fn should_float(&self) -> bool {
match self {
FloatingLayerBehaviour::Tile => false,
FloatingLayerBehaviour::Float => true,
}
}
}
impl Placement {
pub fn should_center(&self) -> bool {
match self {
Placement::None => false,
Placement::Center | Placement::CenterAndResize => true,
}
}
pub fn should_resize(&self) -> bool {
match self {
Placement::None | Placement::Center => false,
Placement::CenterAndResize => true,
}
}
}
#[derive(
Clone,
Copy,
@@ -368,19 +294,6 @@ pub enum PlacementMatchingRules {
Many(Vec<config_generation::MatchingRule>),
}
#[derive(
Clone, Copy, Debug, Default, Serialize, Deserialize, Display, EnumString, ValueEnum, PartialEq,
)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Behaviour when an action would cross a monitor boundary
pub enum CrossBoundaryBehaviour {
/// Attempt to perform actions across a workspace boundary
Workspace,
/// Attempt to perform actions across a monitor boundary
#[default]
Monitor,
}
pub use komorebi_protocol::message::SocketMessage;
#[cfg(test)]