Skip to content

GlazeWM is a tiling window manager for macOS and Windows inspired by i3wm.

wip

Lars Berger097774f2444a
diff --git a/packages/wm/src/common/platform/event_listener.rs b/packages/wm/src/common/platform/event_listener.rs
index 892cb929..68c17fa2 100644
--- a/packages/wm/src/common/platform/event_listener.rs
+++ b/packages/wm/src/common/platform/event_listener.rs
@@ -32,7 +32,9 @@ pub struct EventListener {
}
impl EventListener {
- /// Starts listening for platform events.
+ /// Initializes listener for platform events.
+ ///
+ /// Creates an instance of `EventListener`.
pub async fn start(config: Arc<Mutex<UserConfig>>) -> Result<Self> {
let (event_tx, event_rx) = mpsc::unbounded_channel();
let config = config.lock().await;
@@ -49,6 +51,7 @@ impl EventListener {
})
}
+ /// Updates the event listener with the latest user config.
pub fn update(&mut self, config: &UserConfig) {
self.event_window.update(
config.keybindings.clone(),
diff --git a/packages/wm/src/windows/mod.rs b/packages/wm/src/windows/mod.rs
index 68624db0..57f33996 100644
--- a/packages/wm/src/windows/mod.rs
+++ b/packages/wm/src/windows/mod.rs
@@ -1,3 +1,4 @@
+pub mod commands;
mod non_tiling_window;
mod tiling_window;
pub mod traits;
diff --git a/packages/wm/src/windows/non_tiling_window.rs b/packages/wm/src/windows/non_tiling_window.rs
index 11a0c080..30958eea 100644
--- a/packages/wm/src/windows/non_tiling_window.rs
+++ b/packages/wm/src/windows/non_tiling_window.rs
@@ -1,10 +1,13 @@
use std::{cell::RefCell, rc::Rc};
+use crate::workspaces::WorkspaceRef;
+
#[derive(Clone, Debug)]
pub struct NonTilingWindowRef(Rc<RefCell<NonTilingWindow>>);
#[derive(Debug)]
pub struct NonTilingWindow {
+ parent: Option<WorkspaceRef>,
width: u32,
height: u32,
x: u32,
@@ -14,6 +17,7 @@ pub struct NonTilingWindow {
impl NonTilingWindow {
pub fn new() -> Self {
Self {
+ parent: None,
width: 0,
height: 0,
x: 0,
diff --git a/packages/wm/src/wm.rs b/packages/wm/src/wm.rs
index cf95cc28..69efe765 100644
--- a/packages/wm/src/wm.rs
+++ b/packages/wm/src/wm.rs
@@ -46,6 +46,73 @@ impl WindowManager {
}
pub async fn process_command(&mut self, command: WmCommand) {
- todo!()
+ match command {
+ WmCommand::CloseWindow => {
+ todo!()
+ }
+ WmCommand::DisableBindingMode(_) => {
+ todo!()
+ }
+ WmCommand::ExitWm => {
+ todo!()
+ }
+ WmCommand::EnableBindingMode(_) => {
+ todo!()
+ }
+ WmCommand::FocusInDirection(_) => {
+ todo!()
+ }
+ WmCommand::FocusRecentWorkspace => {
+ todo!()
+ }
+ WmCommand::FocusWorkspaceInSequence => {
+ todo!()
+ }
+ WmCommand::FocusWorkspace(_) => {
+ todo!()
+ }
+ WmCommand::IgnoreWindow => {
+ todo!()
+ }
+ WmCommand::MoveWindow(_) => {
+ todo!()
+ }
+ WmCommand::MoveWindowToWorkspace(_) => {
+ todo!()
+ }
+ WmCommand::MoveWorkspace(_) => {
+ todo!()
+ }
+ WmCommand::Noop => {
+ todo!()
+ }
+ WmCommand::Redraw => {
+ todo!()
+ }
+ WmCommand::ReloadConfig => {
+ todo!()
+ }
+ WmCommand::ResizeWindowWidth(_) => {
+ todo!()
+ }
+ WmCommand::ResizeWindowHeight(_) => {
+ todo!()
+ }
+ WmCommand::SetTilingDirection(_) => {
+ todo!()
+ }
+ WmCommand::SetWindowBorders(_) => {
+ todo!()
+ }
+ WmCommand::SetWindowFloating => {
+ todo!()
+ }
+ WmCommand::ToggleTilingDirection => {
+ todo!()
+ }
+ WmCommand::ToggleFocusMode => {
+ todo!()
+ }
+ }
}
}
diff --git a/packages/wm/src/workspaces/workspace.rs b/packages/wm/src/workspaces/workspace.rs
index eb1443b2..72d0b73a 100644
--- a/packages/wm/src/workspaces/workspace.rs
+++ b/packages/wm/src/workspaces/workspace.rs
@@ -1,6 +1,6 @@
use std::{cell::RefCell, rc::Rc};
-use crate::common::RectDelta;
+use crate::{common::RectDelta, containers::ContainerRef};
#[derive(Clone, Debug)]
pub struct WorkspaceRef(Rc<RefCell<Workspace>>);
@@ -11,6 +11,8 @@ pub struct Workspace {
display_name: String,
keep_alive: bool,
outer_gaps: RectDelta,
+ tiling_children: Vec<ContainerRef>,
+ non_tiling_children: Vec<ContainerRef>,
}
impl Workspace {
@@ -25,6 +27,8 @@ impl Workspace {
display_name,
keep_alive,
outer_gaps,
+ tiling_children: Vec::new(),
+ non_tiling_children: Vec::new(),
}
}
}