Skip to content

Commit

Permalink
refactor: remove ShowAllWindowsHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-berger committed Dec 18, 2023
1 parent 61ea291 commit 6245b63
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 35 deletions.
12 changes: 11 additions & 1 deletion GlazeWM.App.WindowManager/WmStartup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public sealed class WmStartup
{
private readonly Bus _bus;
private readonly KeybindingService _keybindingService;
private readonly WindowService _windowService;
private readonly WindowEventService _windowEventService;
private readonly UserConfigService _userConfigService;

Expand All @@ -27,11 +28,13 @@ public sealed class WmStartup
public WmStartup(
Bus bus,
KeybindingService keybindingService,
WindowService windowService,
WindowEventService windowEventService,
UserConfigService userConfigService)
{
_bus = bus;
_keybindingService = keybindingService;
_windowService = windowService;
_windowEventService = windowEventService;
_userConfigService = userConfigService;
}
Expand Down Expand Up @@ -132,9 +135,16 @@ windowAnimations is WindowAnimations.True

private void OnApplicationExit()
{
_bus.Invoke(new ShowAllWindowsCommand());
// Show all windows regardless of whether their workspace is displayed.
foreach (var window in _windowService.GetWindows())
ShowWindowAsync(window.Handle, ShowWindowFlags.ShowNoActivate);

// Clear border on the active window.
_bus.Invoke(new SetActiveWindowBorderCommand(null));

// Destroy the system tray icon.
_systemTrayIcon?.Remove();

System.Windows.Forms.Application.Exit();
}
}
Expand Down
1 change: 0 additions & 1 deletion GlazeWM.Domain/DependencyInjection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ public static IServiceCollection AddDomainServices(this IServiceCollection servi
services.AddSingleton<ICommandHandler<SetMinimizedCommand>, SetMinimizedHandler>();
services.AddSingleton<ICommandHandler<SetTilingCommand>, SetTilingHandler>();
services.AddSingleton<ICommandHandler<SetWindowSizeCommand>, SetWindowSizeHandler>();
services.AddSingleton<ICommandHandler<ShowAllWindowsCommand>, ShowAllWindowsHandler>();
services.AddSingleton<ICommandHandler<ToggleFloatingCommand>, ToggleFloatingHandler>();
services.AddSingleton<ICommandHandler<ToggleMaximizedCommand>, ToggleMaximizedHandler>();
services.AddSingleton<ICommandHandler<UnmanageWindowCommand>, UnmanageWindowHandler>();
Expand Down
25 changes: 0 additions & 25 deletions GlazeWM.Domain/Windows/CommandHandlers/ShowAllWindowsHandler.cs

This file was deleted.

8 changes: 0 additions & 8 deletions GlazeWM.Domain/Windows/Commands/ShowAllWindowsCommand.cs

This file was deleted.

0 comments on commit 6245b63

Please sign in to comment.