Skip to content

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

feat(domain): prevent some commands from being invokable when a floating window is focused

Lars Berger5a1eebace796
diff --git a/GlazeWM.Domain/Windows/CommandHandlers/MoveFocusedWindowHandler.cs b/GlazeWM.Domain/Windows/CommandHandlers/MoveFocusedWindowHandler.cs
index f5087fef..6b30569d 100644
--- a/GlazeWM.Domain/Windows/CommandHandlers/MoveFocusedWindowHandler.cs
+++ b/GlazeWM.Domain/Windows/CommandHandlers/MoveFocusedWindowHandler.cs
@@ -27,9 +27,9 @@ namespace GlazeWM.Domain.Windows.CommandHandlers
public CommandResponse Handle(MoveFocusedWindowCommand command)
{
- var focusedWindow = _containerService.FocusedContainer as Window;
+ var focusedWindow = _containerService.FocusedContainer as TilingWindow;
- // Ignore cases where focused container is not a window.
+ // Ignore cases where focused container is not a tiling window.
if (focusedWindow == null)
return CommandResponse.Ok;
diff --git a/GlazeWM.Domain/Windows/CommandHandlers/ResizeFocusedWindowHandler.cs b/GlazeWM.Domain/Windows/CommandHandlers/ResizeFocusedWindowHandler.cs
index 23a755b0..f3860647 100644
--- a/GlazeWM.Domain/Windows/CommandHandlers/ResizeFocusedWindowHandler.cs
+++ b/GlazeWM.Domain/Windows/CommandHandlers/ResizeFocusedWindowHandler.cs
@@ -26,9 +26,9 @@ namespace GlazeWM.Domain.Windows.CommandHandlers
public CommandResponse Handle(ResizeFocusedWindowCommand command)
{
- var focusedWindow = _containerService.FocusedContainer as Window;
+ var focusedWindow = _containerService.FocusedContainer as TilingWindow;
- // Ignore cases where focused container is not a window.
+ // Ignore cases where focused container is not a tiling window.
if (focusedWindow == null)
return CommandResponse.Ok;
diff --git a/GlazeWM.Domain/Workspaces/CommandHandlers/MoveFocusedWindowToWorkspaceHandler.cs b/GlazeWM.Domain/Workspaces/CommandHandlers/MoveFocusedWindowToWorkspaceHandler.cs
index c8df30ce..b5a15546 100644
--- a/GlazeWM.Domain/Workspaces/CommandHandlers/MoveFocusedWindowToWorkspaceHandler.cs
+++ b/GlazeWM.Domain/Workspaces/CommandHandlers/MoveFocusedWindowToWorkspaceHandler.cs
@@ -26,10 +26,10 @@ namespace GlazeWM.Domain.Workspaces.CommandHandlers
public CommandResponse Handle(MoveFocusedWindowToWorkspaceCommand command)
{
var workspaceName = command.WorkspaceName;
- var focusedWindow = _containerService.FocusedContainer as Window;
+ var focusedWindow = _containerService.FocusedContainer as TilingWindow;
var foregroundWindow = GetForegroundWindow();
- // Ignore cases where focused container is not a window or not in foreground.
+ // Ignore cases where focused container is not a tiling window or not in foreground.
if (focusedWindow == null || foregroundWindow != focusedWindow.Hwnd)
return CommandResponse.Ok;