Skip to content

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

feat: added AddMonitorCommand and empty MonitorAddedHandler

Larsb063578f2a6d
diff --git a/LarsWM/Monitors/Commands/AddMonitorCommand.cs b/LarsWM/Monitors/Commands/AddMonitorCommand.cs
new file mode 100644
index 00000000..0ded0da1
--- /dev/null
+++ b/LarsWM/Monitors/Commands/AddMonitorCommand.cs
@@ -0,0 +1,11 @@
+using LarsWM.Common.Models;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace LarsWM.Monitors.Commands
+{
+ class AddMonitorCommand : ICommand<Monitor>
+ {
+ }
+}
diff --git a/LarsWM/Monitors/EventHandlers/MonitorAddedHandler.cs b/LarsWM/Monitors/EventHandlers/MonitorAddedHandler.cs
new file mode 100644
index 00000000..bb1c6323
--- /dev/null
+++ b/LarsWM/Monitors/EventHandlers/MonitorAddedHandler.cs
@@ -0,0 +1,35 @@
+using LarsWM.Common.Models;
+using LarsWM.Monitors.Events;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace LarsWM.Monitors.EventHandler
+{
+ class MonitorAddedHandler : IEventHandler<MonitorAddedEvent>
+ {
+ private IBus _bus;
+
+ public MonitorAddedHandler(IBus bus)
+ {
+ _bus = bus;
+ }
+
+ public void Handle(MonitorAddedEvent msg)
+ {
+ throw new System.NotImplementedException();
+
+ // Create an initial Workspace for each Monitor
+ int index = 0;
+ foreach (var monitor in msg.monitors)
+ {
+ // TODO: add IsFocused property to focused window, workspace & monitor
+ var newWorkspace = new Workspace(index, new List<Window>());
+ monitor.WorkspacesInMonitor.Add(newWorkspace);
+ monitor.DisplayedWorkspace = newWorkspace;
+
+ index++;
+ }
+ }
+ }
+}