Skip to content

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

refactor(domain): flip `Window` property `IsHidden` to be `IsDisplayed`

Lars Berger4fc8ae986f62
diff --git a/GlazeWM.Domain/Containers/CommandHandlers/RedrawContainersHandler.cs b/GlazeWM.Domain/Containers/CommandHandlers/RedrawContainersHandler.cs
index e1adc742..6d078b7b 100644
--- a/GlazeWM.Domain/Containers/CommandHandlers/RedrawContainersHandler.cs
+++ b/GlazeWM.Domain/Containers/CommandHandlers/RedrawContainersHandler.cs
@@ -41,10 +41,10 @@ namespace GlazeWM.Domain.Containers.CommandHandlers
var flags = SWP.SWP_FRAMECHANGED | SWP.SWP_NOACTIVATE | SWP.SWP_NOCOPYBITS |
SWP.SWP_NOZORDER | SWP.SWP_NOOWNERZORDER | SWP.SWP_NOSENDCHANGING;
- if (window.IsHidden)
- flags |= SWP.SWP_HIDEWINDOW;
- else
+ if (window.IsDisplayed)
flags |= SWP.SWP_SHOWWINDOW;
+ else
+ flags |= SWP.SWP_HIDEWINDOW;
SetWindowPosition(window, flags);
diff --git a/GlazeWM.Domain/Windows/EventHandlers/WindowHiddenHandler.cs b/GlazeWM.Domain/Windows/EventHandlers/WindowHiddenHandler.cs
index e920f33d..a4ce5776 100644
--- a/GlazeWM.Domain/Windows/EventHandlers/WindowHiddenHandler.cs
+++ b/GlazeWM.Domain/Windows/EventHandlers/WindowHiddenHandler.cs
@@ -43,7 +43,7 @@ namespace GlazeWM.Domain.Windows.EventHandlers
// Ignore events where the window isn't managed or is actually supposed to be hidden. Since
// window events are processed in a sequence, also handle case where the window is not
// actually hidden anymore when the event is processed.
- if (window?.IsHidden != false || WindowService.IsHandleVisible(window.Hwnd))
+ if (window is null || !window.IsDisplayed || WindowService.IsHandleVisible(window.Hwnd))
return;
_logger.LogWindowEvent("Window hidden", window);
diff --git a/GlazeWM.Domain/Windows/Window.cs b/GlazeWM.Domain/Windows/Window.cs
index 04faf5f1..ff6a1038 100644
--- a/GlazeWM.Domain/Windows/Window.cs
+++ b/GlazeWM.Domain/Windows/Window.cs
@@ -36,9 +36,9 @@ namespace GlazeWM.Domain.Windows
}
/// <summary>
- /// Windows are hidden if their parent workspace is not displayed.
+ /// Windows are displayed if their parent workspace is displayed.
/// </summary>
- public bool IsHidden => !WorkspaceService.GetWorkspaceFromChildContainer(this).IsDisplayed;
+ public bool IsDisplayed => WorkspaceService.GetWorkspaceFromChildContainer(this).IsDisplayed;
public string ProcessName => WindowService.GetProcessOfHandle(Hwnd)?.ProcessName ?? string.Empty;