debug: First iteration
- Flesh out FPS counters and graph - Add opacity slider - Add specialized views - Populate workspace state inspector (very basic)
This commit is contained in:
parent
c1484cdb02
commit
5315abb9f1
9 changed files with 234 additions and 115 deletions
|
|
@ -8,14 +8,14 @@ pub use smithay::{
|
|||
};
|
||||
use std::{cell::Cell, mem::MaybeUninit};
|
||||
|
||||
const MAX_WORKSPACES: usize = 10; // TODO?
|
||||
pub const MAX_WORKSPACES: usize = 10; // TODO?
|
||||
|
||||
pub struct ActiveWorkspace(Cell<Option<usize>>);
|
||||
impl ActiveWorkspace {
|
||||
fn new() -> Self {
|
||||
ActiveWorkspace(Cell::new(None))
|
||||
}
|
||||
fn get(&self) -> Option<usize> {
|
||||
pub fn get(&self) -> Option<usize> {
|
||||
self.0.get()
|
||||
}
|
||||
fn set(&self, active: usize) -> Option<usize> {
|
||||
|
|
@ -26,6 +26,7 @@ impl ActiveWorkspace {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
|
||||
pub enum Mode {
|
||||
OutputBound,
|
||||
Global { active: usize },
|
||||
|
|
@ -44,7 +45,7 @@ impl Mode {
|
|||
pub struct Workspaces {
|
||||
mode: Mode,
|
||||
outputs: Vec<Output>,
|
||||
spaces: [Space; MAX_WORKSPACES],
|
||||
pub spaces: [Space; MAX_WORKSPACES],
|
||||
}
|
||||
|
||||
const UNINIT_SPACE: MaybeUninit<Space> = MaybeUninit::uninit();
|
||||
|
|
@ -166,6 +167,11 @@ impl Workspaces {
|
|||
};
|
||||
}
|
||||
|
||||
#[cfg(feature = "debug")]
|
||||
pub fn mode(&self) -> &Mode {
|
||||
&self.mode
|
||||
}
|
||||
|
||||
pub fn set_mode(&mut self, mode: Mode) {
|
||||
match (&mut self.mode, mode) {
|
||||
(Mode::OutputBound, Mode::Global { .. }) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue