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.
This commit is contained in:
omark96
2025-09-02 00:44:51 +02:00
committed by Jeezy
parent 3dad77533b
commit 1db572f789
2 changed files with 3 additions and 3 deletions

View File

@@ -306,7 +306,7 @@ pub fn current_virtual_desktop() -> Option<Vec<u8>> {
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,

View File

@@ -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<Monitor>,