Skip to content

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

refactor(infra): move out events under `WindowsApi` dir to `Common`

Lars Berger7b30fdbfb3ce
diff --git a/GlazeWM.Bootstrapper/Startup.cs b/GlazeWM.Bootstrapper/Startup.cs
index b81a1ebb..eec93780 100644
--- a/GlazeWM.Bootstrapper/Startup.cs
+++ b/GlazeWM.Bootstrapper/Startup.cs
@@ -3,9 +3,9 @@ using GlazeWM.Domain.Common.Commands;
using GlazeWM.Domain.UserConfigs.Commands;
using GlazeWM.Domain.Windows.Commands;
using GlazeWM.Infrastructure.Bussing;
+using GlazeWM.Infrastructure.Common.Events;
using GlazeWM.Infrastructure.Exceptions;
using GlazeWM.Infrastructure.WindowsApi;
-using GlazeWM.Infrastructure.WindowsApi.Events;
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/GlazeWM.Domain/DependencyInjection.cs b/GlazeWM.Domain/DependencyInjection.cs
index 6086aed8..5dfa94ac 100644
--- a/GlazeWM.Domain/DependencyInjection.cs
+++ b/GlazeWM.Domain/DependencyInjection.cs
@@ -18,7 +18,7 @@ using GlazeWM.Domain.Workspaces;
using GlazeWM.Domain.Workspaces.CommandHandlers;
using GlazeWM.Domain.Workspaces.Commands;
using GlazeWM.Infrastructure.Bussing;
-using GlazeWM.Infrastructure.WindowsApi.Events;
+using GlazeWM.Infrastructure.Common.Events;
using Microsoft.Extensions.DependencyInjection;
namespace GlazeWM.Domain
diff --git a/GlazeWM.Domain/Monitors/EventHandlers/DisplaySettingsChangedHandler.cs b/GlazeWM.Domain/Monitors/EventHandlers/DisplaySettingsChangedHandler.cs
index c801a8f1..fa87075f 100644
--- a/GlazeWM.Domain/Monitors/EventHandlers/DisplaySettingsChangedHandler.cs
+++ b/GlazeWM.Domain/Monitors/EventHandlers/DisplaySettingsChangedHandler.cs
@@ -1,6 +1,6 @@
using GlazeWM.Domain.Monitors.Commands;
using GlazeWM.Infrastructure.Bussing;
-using GlazeWM.Infrastructure.WindowsApi.Events;
+using GlazeWM.Infrastructure.Common.Events;
namespace GlazeWM.Domain.Monitors.EventHandlers
{
diff --git a/GlazeWM.Domain/Windows/EventHandlers/WindowDestroyedHandler.cs b/GlazeWM.Domain/Windows/EventHandlers/WindowDestroyedHandler.cs
index 17bd1bdf..9cf89f64 100644
--- a/GlazeWM.Domain/Windows/EventHandlers/WindowDestroyedHandler.cs
+++ b/GlazeWM.Domain/Windows/EventHandlers/WindowDestroyedHandler.cs
@@ -4,7 +4,7 @@ using GlazeWM.Domain.Containers.Commands;
using GlazeWM.Domain.Monitors.Commands;
using GlazeWM.Domain.Windows.Commands;
using GlazeWM.Infrastructure.Bussing;
-using GlazeWM.Infrastructure.WindowsApi.Events;
+using GlazeWM.Infrastructure.Common.Events;
using Microsoft.Extensions.Logging;
namespace GlazeWM.Domain.Windows.EventHandlers
diff --git a/GlazeWM.Domain/Windows/EventHandlers/WindowFocusedHandler.cs b/GlazeWM.Domain/Windows/EventHandlers/WindowFocusedHandler.cs
index e7c04d77..bbaad085 100644
--- a/GlazeWM.Domain/Windows/EventHandlers/WindowFocusedHandler.cs
+++ b/GlazeWM.Domain/Windows/EventHandlers/WindowFocusedHandler.cs
@@ -6,7 +6,7 @@ using GlazeWM.Domain.Containers.Events;
using GlazeWM.Domain.Windows.Commands;
using GlazeWM.Domain.Workspaces;
using GlazeWM.Infrastructure.Bussing;
-using GlazeWM.Infrastructure.WindowsApi.Events;
+using GlazeWM.Infrastructure.Common.Events;
using Microsoft.Extensions.Logging;
using static GlazeWM.Infrastructure.WindowsApi.WindowsApiService;
diff --git a/GlazeWM.Domain/Windows/EventHandlers/WindowHiddenHandler.cs b/GlazeWM.Domain/Windows/EventHandlers/WindowHiddenHandler.cs
index 0d2e15f5..00c6c74f 100644
--- a/GlazeWM.Domain/Windows/EventHandlers/WindowHiddenHandler.cs
+++ b/GlazeWM.Domain/Windows/EventHandlers/WindowHiddenHandler.cs
@@ -4,7 +4,7 @@ using GlazeWM.Domain.Containers.Commands;
using GlazeWM.Domain.Monitors.Commands;
using GlazeWM.Domain.Windows.Commands;
using GlazeWM.Infrastructure.Bussing;
-using GlazeWM.Infrastructure.WindowsApi.Events;
+using GlazeWM.Infrastructure.Common.Events;
using Microsoft.Extensions.Logging;
namespace GlazeWM.Domain.Windows.EventHandlers
diff --git a/GlazeWM.Domain/Windows/EventHandlers/WindowLocationChangedHandler.cs b/GlazeWM.Domain/Windows/EventHandlers/WindowLocationChangedHandler.cs
index faa30879..23213b8b 100644
--- a/GlazeWM.Domain/Windows/EventHandlers/WindowLocationChangedHandler.cs
+++ b/GlazeWM.Domain/Windows/EventHandlers/WindowLocationChangedHandler.cs
@@ -1,6 +1,6 @@
using GlazeWM.Domain.Monitors.Commands;
using GlazeWM.Infrastructure.Bussing;
-using GlazeWM.Infrastructure.WindowsApi.Events;
+using GlazeWM.Infrastructure.Common.Events;
namespace GlazeWM.Domain.Windows.EventHandlers
{
diff --git a/GlazeWM.Domain/Windows/EventHandlers/WindowMinimizeEndedHandler.cs b/GlazeWM.Domain/Windows/EventHandlers/WindowMinimizeEndedHandler.cs
index 4fa68176..9247c90c 100644
--- a/GlazeWM.Domain/Windows/EventHandlers/WindowMinimizeEndedHandler.cs
+++ b/GlazeWM.Domain/Windows/EventHandlers/WindowMinimizeEndedHandler.cs
@@ -5,7 +5,7 @@ using GlazeWM.Domain.Containers;
using GlazeWM.Domain.Containers.Commands;
using GlazeWM.Domain.Workspaces;
using GlazeWM.Infrastructure.Bussing;
-using GlazeWM.Infrastructure.WindowsApi.Events;
+using GlazeWM.Infrastructure.Common.Events;
using Microsoft.Extensions.Logging;
namespace GlazeWM.Domain.Windows.EventHandlers
diff --git a/GlazeWM.Domain/Windows/EventHandlers/WindowMinimizedHandler.cs b/GlazeWM.Domain/Windows/EventHandlers/WindowMinimizedHandler.cs
index 3647b789..1a004b14 100644
--- a/GlazeWM.Domain/Windows/EventHandlers/WindowMinimizedHandler.cs
+++ b/GlazeWM.Domain/Windows/EventHandlers/WindowMinimizedHandler.cs
@@ -5,7 +5,7 @@ using GlazeWM.Domain.Containers.Commands;
using GlazeWM.Domain.Windows.Commands;
using GlazeWM.Domain.Workspaces;
using GlazeWM.Infrastructure.Bussing;
-using GlazeWM.Infrastructure.WindowsApi.Events;
+using GlazeWM.Infrastructure.Common.Events;
using Microsoft.Extensions.Logging;
using static GlazeWM.Infrastructure.WindowsApi.WindowsApiService;
diff --git a/GlazeWM.Domain/Windows/EventHandlers/WindowMovedOrResizedHandler.cs b/GlazeWM.Domain/Windows/EventHandlers/WindowMovedOrResizedHandler.cs
index 390008c7..03706e4f 100644
--- a/GlazeWM.Domain/Windows/EventHandlers/WindowMovedOrResizedHandler.cs
+++ b/GlazeWM.Domain/Windows/EventHandlers/WindowMovedOrResizedHandler.cs
@@ -8,8 +8,8 @@ using GlazeWM.Domain.Monitors;
using GlazeWM.Domain.Windows.Commands;
using GlazeWM.Domain.Workspaces;
using GlazeWM.Infrastructure.Bussing;
+using GlazeWM.Infrastructure.Common.Events;
using GlazeWM.Infrastructure.WindowsApi;
-using GlazeWM.Infrastructure.WindowsApi.Events;
using Microsoft.Extensions.Logging;
namespace GlazeWM.Domain.Windows.EventHandlers
diff --git a/GlazeWM.Domain/Windows/EventHandlers/WindowShownHandler.cs b/GlazeWM.Domain/Windows/EventHandlers/WindowShownHandler.cs
index 0b446ece..342993f0 100644
--- a/GlazeWM.Domain/Windows/EventHandlers/WindowShownHandler.cs
+++ b/GlazeWM.Domain/Windows/EventHandlers/WindowShownHandler.cs
@@ -2,7 +2,7 @@
using GlazeWM.Domain.Monitors.Commands;
using GlazeWM.Domain.Windows.Commands;
using GlazeWM.Infrastructure.Bussing;
-using GlazeWM.Infrastructure.WindowsApi.Events;
+using GlazeWM.Infrastructure.Common.Events;
namespace GlazeWM.Domain.Windows.EventHandlers
{
diff --git a/GlazeWM.Infrastructure/Common/CommandHandlers/ExitApplicationHandler.cs b/GlazeWM.Infrastructure/Common/CommandHandlers/ExitApplicationHandler.cs
index 9f0288eb..a0ad215d 100644
--- a/GlazeWM.Infrastructure/Common/CommandHandlers/ExitApplicationHandler.cs
+++ b/GlazeWM.Infrastructure/Common/CommandHandlers/ExitApplicationHandler.cs
@@ -1,7 +1,7 @@
using System;
using GlazeWM.Infrastructure.Bussing;
using GlazeWM.Infrastructure.Common.Commands;
-using GlazeWM.Infrastructure.WindowsApi.Events;
+using GlazeWM.Infrastructure.Common.Events;
namespace GlazeWM.Infrastructure.Common.CommandHandlers
{
diff --git a/GlazeWM.Infrastructure/WindowsApi/Events/ApplicationExitingEvent.cs b/GlazeWM.Infrastructure/Common/Events/ApplicationExitingEvent.cs
similarity index 65%
rename from GlazeWM.Infrastructure/WindowsApi/Events/ApplicationExitingEvent.cs
rename to GlazeWM.Infrastructure/Common/Events/ApplicationExitingEvent.cs
index 4de34d0f..a83a4655 100644
--- a/GlazeWM.Infrastructure/WindowsApi/Events/ApplicationExitingEvent.cs
+++ b/GlazeWM.Infrastructure/Common/Events/ApplicationExitingEvent.cs
@@ -1,6 +1,6 @@
using GlazeWM.Infrastructure.Bussing;
-namespace GlazeWM.Infrastructure.WindowsApi.Events
+namespace GlazeWM.Infrastructure.Common.Events
{
public class ApplicationExitingEvent : Event
{
diff --git a/GlazeWM.Infrastructure/WindowsApi/Events/DisplaySettingsChangedEvent.cs b/GlazeWM.Infrastructure/Common/Events/DisplaySettingsChangedEvent.cs
similarity index 66%
rename from GlazeWM.Infrastructure/WindowsApi/Events/DisplaySettingsChangedEvent.cs
rename to GlazeWM.Infrastructure/Common/Events/DisplaySettingsChangedEvent.cs
index e61e3d10..06f73a79 100644
--- a/GlazeWM.Infrastructure/WindowsApi/Events/DisplaySettingsChangedEvent.cs
+++ b/GlazeWM.Infrastructure/Common/Events/DisplaySettingsChangedEvent.cs
@@ -1,6 +1,6 @@
using GlazeWM.Infrastructure.Bussing;
-namespace GlazeWM.Infrastructure.WindowsApi.Events
+namespace GlazeWM.Infrastructure.Common.Events
{
public class DisplaySettingsChangedEvent : Event
{
diff --git a/GlazeWM.Infrastructure/WindowsApi/Events/WindowDestroyedEvent.cs b/GlazeWM.Infrastructure/Common/Events/WindowDestroyedEvent.cs
similarity index 83%
rename from GlazeWM.Infrastructure/WindowsApi/Events/WindowDestroyedEvent.cs
rename to GlazeWM.Infrastructure/Common/Events/WindowDestroyedEvent.cs
index 5a7ec23a..62db68bd 100644
--- a/GlazeWM.Infrastructure/WindowsApi/Events/WindowDestroyedEvent.cs
+++ b/GlazeWM.Infrastructure/Common/Events/WindowDestroyedEvent.cs
@@ -1,7 +1,7 @@
using System;
using GlazeWM.Infrastructure.Bussing;
-namespace GlazeWM.Infrastructure.WindowsApi.Events
+namespace GlazeWM.Infrastructure.Common.Events
{
public class WindowDestroyedEvent : Event
{
diff --git a/GlazeWM.Infrastructure/WindowsApi/Events/WindowFocusedEvent.cs b/GlazeWM.Infrastructure/Common/Events/WindowFocusedEvent.cs
similarity index 83%
rename from GlazeWM.Infrastructure/WindowsApi/Events/WindowFocusedEvent.cs
rename to GlazeWM.Infrastructure/Common/Events/WindowFocusedEvent.cs
index 3e1c3dea..c396f0b9 100644
--- a/GlazeWM.Infrastructure/WindowsApi/Events/WindowFocusedEvent.cs
+++ b/GlazeWM.Infrastructure/Common/Events/WindowFocusedEvent.cs
@@ -1,7 +1,7 @@
using System;
using GlazeWM.Infrastructure.Bussing;
-namespace GlazeWM.Infrastructure.WindowsApi.Events
+namespace GlazeWM.Infrastructure.Common.Events
{
public class WindowFocusedEvent : Event
{
diff --git a/GlazeWM.Infrastructure/WindowsApi/Events/WindowHiddenEvent.cs b/GlazeWM.Infrastructure/Common/Events/WindowHiddenEvent.cs
similarity index 82%
rename from GlazeWM.Infrastructure/WindowsApi/Events/WindowHiddenEvent.cs
rename to GlazeWM.Infrastructure/Common/Events/WindowHiddenEvent.cs
index 888118fb..b87bc35d 100644
--- a/GlazeWM.Infrastructure/WindowsApi/Events/WindowHiddenEvent.cs
+++ b/GlazeWM.Infrastructure/Common/Events/WindowHiddenEvent.cs
@@ -1,7 +1,7 @@
using System;
using GlazeWM.Infrastructure.Bussing;
-namespace GlazeWM.Infrastructure.WindowsApi.Events
+namespace GlazeWM.Infrastructure.Common.Events
{
public class WindowHiddenEvent : Event
{
diff --git a/GlazeWM.Infrastructure/WindowsApi/Events/WindowLocationChangedEvent.cs b/GlazeWM.Infrastructure/Common/Events/WindowLocationChangedEvent.cs
similarity index 83%
rename from GlazeWM.Infrastructure/WindowsApi/Events/WindowLocationChangedEvent.cs
rename to GlazeWM.Infrastructure/Common/Events/WindowLocationChangedEvent.cs
index df9b2cfe..f5fb6496 100644
--- a/GlazeWM.Infrastructure/WindowsApi/Events/WindowLocationChangedEvent.cs
+++ b/GlazeWM.Infrastructure/Common/Events/WindowLocationChangedEvent.cs
@@ -1,7 +1,7 @@
using System;
using GlazeWM.Infrastructure.Bussing;
-namespace GlazeWM.Infrastructure.WindowsApi.Events
+namespace GlazeWM.Infrastructure.Common.Events
{
public class WindowLocationChangedEvent : Event
{
diff --git a/GlazeWM.Infrastructure/WindowsApi/Events/WindowMinimizeEndedEvent.cs b/GlazeWM.Infrastructure/Common/Events/WindowMinimizeEndedEvent.cs
similarity index 83%
rename from GlazeWM.Infrastructure/WindowsApi/Events/WindowMinimizeEndedEvent.cs
rename to GlazeWM.Infrastructure/Common/Events/WindowMinimizeEndedEvent.cs
index 2b581daf..34ec93a6 100644
--- a/GlazeWM.Infrastructure/WindowsApi/Events/WindowMinimizeEndedEvent.cs
+++ b/GlazeWM.Infrastructure/Common/Events/WindowMinimizeEndedEvent.cs
@@ -1,7 +1,7 @@
using System;
using GlazeWM.Infrastructure.Bussing;
-namespace GlazeWM.Infrastructure.WindowsApi.Events
+namespace GlazeWM.Infrastructure.Common.Events
{
public class WindowMinimizeEndedEvent : Event
{
diff --git a/GlazeWM.Infrastructure/WindowsApi/Events/WindowMinimizedEvent.cs b/GlazeWM.Infrastructure/Common/Events/WindowMinimizedEvent.cs
similarity index 83%
rename from GlazeWM.Infrastructure/WindowsApi/Events/WindowMinimizedEvent.cs
rename to GlazeWM.Infrastructure/Common/Events/WindowMinimizedEvent.cs
index ff06f156..e8488ea9 100644
--- a/GlazeWM.Infrastructure/WindowsApi/Events/WindowMinimizedEvent.cs
+++ b/GlazeWM.Infrastructure/Common/Events/WindowMinimizedEvent.cs
@@ -1,7 +1,7 @@
using System;
using GlazeWM.Infrastructure.Bussing;
-namespace GlazeWM.Infrastructure.WindowsApi.Events
+namespace GlazeWM.Infrastructure.Common.Events
{
public class WindowMinimizedEvent : Event
{
diff --git a/GlazeWM.Infrastructure/WindowsApi/Events/WindowMovedOrResizedEvent.cs b/GlazeWM.Infrastructure/Common/Events/WindowMovedOrResizedEvent.cs
similarity index 83%
rename from GlazeWM.Infrastructure/WindowsApi/Events/WindowMovedOrResizedEvent.cs
rename to GlazeWM.Infrastructure/Common/Events/WindowMovedOrResizedEvent.cs
index 7258b238..2ef9f5f2 100644
--- a/GlazeWM.Infrastructure/WindowsApi/Events/WindowMovedOrResizedEvent.cs
+++ b/GlazeWM.Infrastructure/Common/Events/WindowMovedOrResizedEvent.cs
@@ -1,7 +1,7 @@
using System;
using GlazeWM.Infrastructure.Bussing;
-namespace GlazeWM.Infrastructure.WindowsApi.Events
+namespace GlazeWM.Infrastructure.Common.Events
{
public class WindowMovedOrResizedEvent : Event
{
diff --git a/GlazeWM.Infrastructure/WindowsApi/Events/WindowShownEvent.cs b/GlazeWM.Infrastructure/Common/Events/WindowShownEvent.cs
similarity index 82%
rename from GlazeWM.Infrastructure/WindowsApi/Events/WindowShownEvent.cs
rename to GlazeWM.Infrastructure/Common/Events/WindowShownEvent.cs
index 5bb884a5..6c2fccfa 100644
--- a/GlazeWM.Infrastructure/WindowsApi/Events/WindowShownEvent.cs
+++ b/GlazeWM.Infrastructure/Common/Events/WindowShownEvent.cs
@@ -1,7 +1,7 @@
using System;
using GlazeWM.Infrastructure.Bussing;
-namespace GlazeWM.Infrastructure.WindowsApi.Events
+namespace GlazeWM.Infrastructure.Common.Events
{
public class WindowShownEvent : Event
{
diff --git a/GlazeWM.Infrastructure/WindowsApi/SystemEventService.cs b/GlazeWM.Infrastructure/WindowsApi/SystemEventService.cs
index b34ea4dd..a199202c 100644
--- a/GlazeWM.Infrastructure/WindowsApi/SystemEventService.cs
+++ b/GlazeWM.Infrastructure/WindowsApi/SystemEventService.cs
@@ -1,5 +1,5 @@
using GlazeWM.Infrastructure.Bussing;
-using GlazeWM.Infrastructure.WindowsApi.Events;
+using GlazeWM.Infrastructure.Common.Events;
using Microsoft.Win32;
using System;
using System.Reactive.Linq;
diff --git a/GlazeWM.Infrastructure/WindowsApi/WindowEventService.cs b/GlazeWM.Infrastructure/WindowsApi/WindowEventService.cs
index f6393f77..d1a35bb5 100644
--- a/GlazeWM.Infrastructure/WindowsApi/WindowEventService.cs
+++ b/GlazeWM.Infrastructure/WindowsApi/WindowEventService.cs
@@ -1,6 +1,6 @@
-using GlazeWM.Infrastructure.Bussing;
+using GlazeWM.Infrastructure.Bussing;
+using GlazeWM.Infrastructure.Common.Events;
using GlazeWM.Infrastructure.WindowsApi.Enums;
-using GlazeWM.Infrastructure.WindowsApi.Events;
using System;
using static GlazeWM.Infrastructure.WindowsApi.WindowsApiService;