| 1 | use x11rb::protocol::randr::Output; |
| 2 | |
| 3 | use super::tree::Rect; |
| 4 | |
| 5 | #[derive(Debug, Clone)] |
| 6 | pub struct Monitor { |
| 7 | pub name: String, |
| 8 | pub output: Output, |
| 9 | pub geometry: Rect, |
| 10 | pub primary: bool, |
| 11 | /// Workspace indices assigned to this monitor |
| 12 | pub workspaces: Vec<usize>, |
| 13 | /// Currently active workspace index on this monitor |
| 14 | pub active_workspace: usize, |
| 15 | } |
| 16 | |
| 17 | impl Monitor { |
| 18 | pub fn new(name: String, output: Output, geometry: Rect) -> Self { |
| 19 | Self { |
| 20 | name, |
| 21 | output, |
| 22 | geometry, |
| 23 | primary: false, |
| 24 | workspaces: Vec::new(), |
| 25 | active_workspace: 0, |
| 26 | } |
| 27 | } |
| 28 | } |
| 29 |