diff --git a/komorebi-for-kde/komorebi/src/core/mod.rs b/komorebi-for-kde/komorebi/src/core/mod.rs index 3fd0620a..954b8b45 100644 --- a/komorebi-for-kde/komorebi/src/core/mod.rs +++ b/komorebi-for-kde/komorebi/src/core/mod.rs @@ -59,7 +59,7 @@ pub use komorebi_protocol::pathext; Clone, Copy, Debug, Default, PartialEq, Serialize, Deserialize, Display, EnumString, ValueEnum, )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -/// Operation behavior for temporarily unmanaged and floating windows +/// Operation behaviour for temporarily unmanaged and floating windows pub enum OperationBehaviour { /// Process commands on temporarily unmanaged/floated windows #[default] @@ -398,7 +398,7 @@ pub enum PlacementMatchingRules { Clone, Copy, Debug, Default, PartialEq, Serialize, Deserialize, Display, EnumString, ValueEnum, )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -/// Move behavior when the operation works across a monitor boundary +/// Move behaviour when the operation works across a monitor boundary pub enum MoveBehaviour { /// Swap the window container with the window container at the edge of the adjacent monitor #[default] @@ -426,7 +426,7 @@ pub enum CrossBoundaryBehaviour { Clone, Copy, Debug, Default, Serialize, Deserialize, Display, EnumString, ValueEnum, PartialEq, )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -/// Behavior when focusing in a direction while a monocle container is active +/// Behaviour when focusing in a direction while a monocle container is active pub enum MonocleFocusBehaviour { /// Cycle the monocle container to the next/previous container in the workspace Cycle, @@ -444,18 +444,19 @@ pub enum ApplicationIdentifier { /// Executable name #[serde(alias = "exe")] Exe, - /// Role or subrole + // the description is part of the checked-in schemas, which differ per platform + #[cfg_attr(target_os = "windows", doc = " Class")] + #[cfg_attr(not(target_os = "windows"), doc = " Role or subrole")] #[serde(alias = "class")] Class, - /// Window title #[serde(alias = "title")] + /// Window title Title, /// Executable path #[serde(alias = "path")] Path, } -/// What a window is to the layout, which decides the color of its border #[derive( Copy, Clone, @@ -471,17 +472,24 @@ pub enum ApplicationIdentifier { Hash, )] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +/// What a window is to the layout, which decides the color of its border pub enum WindowKind { + /// Single window Single, + /// Stack container Stack, + /// Monocle container Monocle, #[default] + /// Unfocused window Unfocused, + /// Unfocused locked container UnfocusedLocked, + /// Floating window Floating, } -/// A question about the window manager that [`SocketMessage::Query`] asks, answered with one +/// A question about the window manager that `SocketMessage::Query` asks, answered with one /// value as text: an index, the name of a layout or of a container kind, or the version of the /// daemon. #[derive(Copy, Clone, Debug, Serialize, Deserialize, Display, EnumString, ValueEnum)] @@ -497,34 +505,14 @@ pub enum StateQuery { Version, } -/// The options of a subscriber, which [`SocketMessage::AddSubscriberSocketWithOptions`] sets +/// The options of a subscriber, which `SocketMessage::AddSubscriberSocketWithOptions` sets /// -/// A subscriber added with [`SocketMessage::AddSubscriberSocket`] has the default options, and is +/// A subscriber added with `SocketMessage::AddSubscriberSocket` has the default options, and is /// sent a notification for every event and message the window manager handles. With /// `filter_state_changes`, it is sent one only when the event or the message changed the -/// [`State`](crate::state::State), and always when a window is shown, when a subscriber is added -/// (so a new subscriber receives the state as soon as it subscribes), when a theme is set (the -/// colors of the borders are not part of the state) and when the configuration is reloaded. -/// -/// # Example -/// -/// ```rust -/// use komorebi::core::SocketMessage; -/// use komorebi::core::SubscribeOptions; -/// -/// let options = SubscribeOptions { -/// filter_state_changes: true, -/// }; -/// let message = SocketMessage::AddSubscriberSocketWithOptions(String::from("bar.sock"), options); -/// assert_eq!( -/// String::from_utf8(message.as_bytes()?)?, -/// r#"{"type":"AddSubscriberSocketWithOptions","content":["bar.sock",{"filter_state_changes":true}]}"#, -/// ); -/// -/// assert!(!SubscribeOptions::default().filter_state_changes); -/// -/// # Ok::<(), Box>(()) -/// ``` +/// state, and always when a window is shown, when a subscriber is added (so a new subscriber +/// receives the state as soon as it subscribes), when a theme is set (the colors of the borders +/// are not part of the state) and when the configuration is reloaded. #[derive(Default, Debug, Copy, Clone, Eq, PartialEq, Serialize, Deserialize)] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct SubscribeOptions { diff --git a/komorebi-for-kde/schema.json b/komorebi-for-kde/schema.json index 015f16d2..3c576349 100644 --- a/komorebi-for-kde/schema.json +++ b/komorebi-for-kde/schema.json @@ -3257,7 +3257,7 @@ ] }, "MonocleFocusBehaviour": { - "description": "Behavior when focusing in a direction while a monocle container is active", + "description": "Behaviour when focusing in a direction while a monocle container is active", "oneOf": [ { "description": "Cycle the monocle container to the next/previous container in the workspace", @@ -3272,7 +3272,7 @@ ] }, "MoveBehaviour": { - "description": "Move behavior when the operation works across a monitor boundary", + "description": "Move behaviour when the operation works across a monitor boundary", "oneOf": [ { "description": "Swap the window container with the window container at the edge of the adjacent monitor", @@ -3292,7 +3292,7 @@ ] }, "OperationBehaviour": { - "description": "Operation behavior for temporarily unmanaged and floating windows", + "description": "Operation behaviour for temporarily unmanaged and floating windows", "oneOf": [ { "description": "Process commands on temporarily unmanaged/floated windows",