Skip to content

Commit

Permalink
feat: add active drag field to window dto
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-berger committed Aug 4, 2024
1 parent 572ef4a commit 138bfe2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/wm/src/windows/active_drag.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#[derive(Debug, Clone, Default)]
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Default, Deserialize, Serialize)]
pub struct ActiveDrag {
pub operation: Option<ActiveDragOperation>,
pub is_from_tiling: bool,
}

#[derive(Debug, Copy, Clone, PartialEq)]
#[derive(Debug, Copy, Clone, Deserialize, PartialEq, Serialize)]
pub enum ActiveDragOperation {
Moving,
Resizing,
Expand Down
1 change: 1 addition & 0 deletions packages/wm/src/windows/non_tiling_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ impl NonTilingWindow {
title: self.native().title()?,
class_name: self.native().class_name()?,
process_name: self.native().process_name()?,
active_drag: self.active_drag(),
}))
}
}
Expand Down
1 change: 1 addition & 0 deletions packages/wm/src/windows/tiling_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ impl TilingWindow {
title: self.native().title()?,
class_name: self.native().class_name()?,
process_name: self.native().process_name()?,
active_drag: self.active_drag(),
}))
}
}
Expand Down
3 changes: 2 additions & 1 deletion packages/wm/src/windows/window_dto.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use serde::{Deserialize, Serialize};
use uuid::Uuid;

use super::WindowState;
use super::{ActiveDrag, WindowState};
use crate::common::{DisplayState, Rect, RectDelta};

/// User-friendly representation of a tiling or non-tiling window.
Expand All @@ -27,4 +27,5 @@ pub struct WindowDto {
pub title: String,
pub class_name: String,
pub process_name: String,
pub active_drag: Option<ActiveDrag>,
}

0 comments on commit 138bfe2

Please sign in to comment.