From 1db572f789e094fc337b5b08917c28f1d9e6d93b Mon Sep 17 00:00:00 2001 From: omark96 <43138339+omark96@users.noreply.github.com> Date: Tue, 2 Sep 2025 00:44:51 +0200 Subject: [PATCH] feat(wm): implement Clone for State, Notification and NotificationEvent This implements Clone for State, Notification and NotificationEvent to allow for the use of these types in Rhai scripts. --- komorebi/src/lib.rs | 4 ++-- komorebi/src/window_manager.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/komorebi/src/lib.rs b/komorebi/src/lib.rs index 503180f0..51820812 100644 --- a/komorebi/src/lib.rs +++ b/komorebi/src/lib.rs @@ -306,7 +306,7 @@ pub fn current_virtual_desktop() -> Option> { current } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[serde(untagged)] pub enum NotificationEvent { @@ -323,7 +323,7 @@ pub enum VirtualDesktopNotification { LeftAssociatedVirtualDesktop, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct Notification { pub event: NotificationEvent, diff --git a/komorebi/src/window_manager.rs b/komorebi/src/window_manager.rs index 751ef4a0..8218eee4 100644 --- a/komorebi/src/window_manager.rs +++ b/komorebi/src/window_manager.rs @@ -126,7 +126,7 @@ pub struct WindowManager { } #[allow(clippy::struct_excessive_bools)] -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct State { pub monitors: Ring,