Skip to content

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

feat(domain): update floating placement when crossing monitors in `MoveFocusedWindowHandler`

Lars Berger0ed4b26fa85b
diff --git a/GlazeWM.Domain/Windows/CommandHandlers/MoveFocusedWindowHandler.cs b/GlazeWM.Domain/Windows/CommandHandlers/MoveFocusedWindowHandler.cs
index 2f933f53..d205d111 100644
--- a/GlazeWM.Domain/Windows/CommandHandlers/MoveFocusedWindowHandler.cs
+++ b/GlazeWM.Domain/Windows/CommandHandlers/MoveFocusedWindowHandler.cs
@@ -129,6 +129,10 @@ namespace GlazeWM.Domain.Windows.CommandHandlers
if (_monitorService.HasDpiDifference(focusedWindow, workspaceInDirection))
focusedWindow.HasPendingDpiAdjustment = true;
+ // Update floating placement since the window has to cross monitors.
+ focusedWindow.FloatingPlacement =
+ focusedWindow.FloatingPlacement.TranslateToCenter(workspaceInDirection.ToRectangle());
+
// TODO: Descend into container if possible.
if (direction == Direction.UP || direction == Direction.LEFT)
_bus.Invoke(new MoveContainerWithinTreeCommand(focusedWindow, workspaceInDirection, true));