Skip to content

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

feat(domain): remove getter for a window's process; instead add getter for process name

Lars Berger40de99410e6c
diff --git a/GlazeWM.Domain/Windows/CommandHandlers/AddWindowHandler.cs b/GlazeWM.Domain/Windows/CommandHandlers/AddWindowHandler.cs
index 11bf1ef4..7a381677 100644
--- a/GlazeWM.Domain/Windows/CommandHandlers/AddWindowHandler.cs
+++ b/GlazeWM.Domain/Windows/CommandHandlers/AddWindowHandler.cs
@@ -79,7 +79,7 @@ namespace GlazeWM.Domain.Windows.CommandHandlers
return _userConfigService.UserConfig.WindowRules
.Where(rule =>
{
- if (rule.ProcessNameRegex != null && !rule.ProcessNameRegex.IsMatch(window.Process.ProcessName))
+ if (rule.ProcessNameRegex != null && !rule.ProcessNameRegex.IsMatch(window.ProcessName))
return false;
if (rule.ClassNameRegex != null && !rule.ClassNameRegex.IsMatch(window.ClassName))
diff --git a/GlazeWM.Domain/Windows/Window.cs b/GlazeWM.Domain/Windows/Window.cs
index c9e20f79..d55ac58d 100644
--- a/GlazeWM.Domain/Windows/Window.cs
+++ b/GlazeWM.Domain/Windows/Window.cs
@@ -1,7 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
using GlazeWM.Domain.Containers;
using GlazeWM.Domain.Workspaces;
using GlazeWM.Infrastructure;
@@ -46,7 +43,7 @@ namespace GlazeWM.Domain.Windows
/// </summary>
public bool IsHidden => !_workspaceService.GetWorkspaceFromChildContainer(this).IsDisplayed;
- public Process Process => _windowService.GetProcessOfHandle(Hwnd);
+ public string ProcessName => _windowService.GetProcessOfHandle(Hwnd).ProcessName;
public string ClassName => _windowService.GetClassNameOfHandle(Hwnd);