Skip to content

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

feat: register UserConfigService, WindowService & WorkspaceService with DI

Larsf68348bd9204
diff --git a/LarsWM.Core/Program.cs b/LarsWM.Core/Program.cs
index cf4db56e..fee5892b 100644
--- a/LarsWM.Core/Program.cs
+++ b/LarsWM.Core/Program.cs
@@ -2,7 +2,10 @@
using LarsWM.Core.Monitors;
using LarsWM.Core.Monitors.CommandHandlers;
using LarsWM.Core.Monitors.EventHandler;
+using LarsWM.Core.UserConfigs;
using LarsWM.Core.UserConfigs.CommandHandlers;
+using LarsWM.Core.Windows;
+using LarsWM.Core.Workspaces;
using LarsWM.Core.Workspaces.CommandHandlers;
using Microsoft.Extensions.DependencyInjection;
using System;
@@ -43,8 +46,10 @@ namespace LarsWM.Core
var serviceCollection = new ServiceCollection();
serviceCollection.AddSingleton<IBus, Bus>();
- serviceCollection.AddSingleton<AppState>();
serviceCollection.AddSingleton<MonitorService>();
+ serviceCollection.AddSingleton<UserConfigService>();
+ serviceCollection.AddSingleton<WindowService>();
+ serviceCollection.AddSingleton<WorkspaceService>();
serviceCollection.AddSingleton<AddMonitorHandler>();
serviceCollection.AddSingleton<MonitorAddedHandler>();
serviceCollection.AddSingleton<ReadUserConfigHandler>();
diff --git a/LarsWM.Core/Startup.cs b/LarsWM.Core/Startup.cs
index 8b7bb3c9..cc3a530e 100644
--- a/LarsWM.Core/Startup.cs
+++ b/LarsWM.Core/Startup.cs
@@ -19,21 +19,19 @@ namespace LarsWM.Core
class Startup
{
private IBus _bus;
- private AppState _appState;
private MonitorService _monitorService;
private List<Monitor> _monitors = new List<Monitor>();
- public Startup(IBus bus, AppState appState, MonitorService monitorService)
+ public Startup(IBus bus, MonitorService monitorService)
{
_bus = bus;
- _appState = appState;
_monitorService = monitorService;
}
public void Init()
{
- // Populate initial monitors, windows, workspaces and user config in AppState.
+ // Populate initial monitors, windows, workspaces and user config.
PopulateState();
// Subscribe to windows hooks
@@ -71,7 +69,7 @@ namespace LarsWM.Core
}
/// <summary>
- /// Populate AppState with initial monitors, windows, workspaces and user config.
+ /// Populate initial monitors, windows, workspaces and user config.
/// </summary>
private void PopulateState()
{