GlazeWM is a tiling window manager for macOS and Windows inspired by i3wm.
feat(bar,boot): register `BarManagerService` for DI; deregister `LaunchBarOnMonitorHandler` and `MonitorAddedHandler`
Lars Bergerb05dc0937bce
diff --git a/LarsWM.Bar/DependencyInjection.cs b/LarsWM.Bar/DependencyInjection.csindex 3316f26e..9e5e85f5 100644--- a/LarsWM.Bar/DependencyInjection.cs+++ b/LarsWM.Bar/DependencyInjection.cs@@ -1,8 +1,4 @@-using LarsWM.Bar.CommandHandlers;-using LarsWM.Bar.EventHandlers;-using LarsWM.Infrastructure.Bussing;-using Microsoft.Extensions.DependencyInjection;-using System;+using Microsoft.Extensions.DependencyInjection;namespace LarsWM.Bar{@@ -10,19 +6,9 @@ namespace LarsWM.Bar{public static IServiceCollection AddBarServices(this IServiceCollection services){- services.AddSingleton<LaunchBarOnMonitorHandler>();- services.AddSingleton<MonitorAddedHandler>();+ services.AddSingleton<BarManagerService>();return services;}-- public static IServiceProvider RegisterBarHandlers(this IServiceProvider serviceProvider)- {- var bus = serviceProvider.GetRequiredService<Bus>();- bus.RegisterCommandHandler<LaunchBarOnMonitorHandler>();- bus.RegisterEventHandler<MonitorAddedHandler>();-- return serviceProvider;- }}}diff --git a/LarsWM.Bootstrapper/Program.cs b/LarsWM.Bootstrapper/Program.csindex bae49b71..2d8fd8b1 100644--- a/LarsWM.Bootstrapper/Program.cs+++ b/LarsWM.Bootstrapper/Program.cs@@ -24,9 +24,7 @@ namespace LarsWM.BootstrapperserviceCollection.AddSingleton<Startup>();ServiceLocator.Provider = serviceCollection.BuildServiceProvider();-ServiceLocator.Provider.RegisterDomainHandlers();- ServiceLocator.Provider.RegisterBarHandlers();var startup = ServiceLocator.Provider.GetRequiredService<Startup>();startup.Init();