Skip to content

Commit

Permalink
Fix that fullscreen is exited if window on a different monitor is foc…
Browse files Browse the repository at this point in the history
…used

closes #35
  • Loading branch information
nikitabobko committed Dec 4, 2023
1 parent 3be89ba commit 4782a05
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/command/FocusCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ private func makeFloatingWindowsSeenAsTiling(workspace: Workspace) -> [FloatingW
let floatingWindows: [FloatingWindowData] = workspace.floatingWindows
.map { (window: Window) -> FloatingWindowData? in
guard let center = window.getCenter() else { return nil }
// todo bug: what if there are now tiling windows on the workspace?
// todo bug: what if there are no tiling windows on the workspace?
guard let target = center.coerceIn(rect: window.workspace.monitor.visibleRectPaddedByOuterGaps).findIn(tree: workspace.rootTilingContainer, virtual: true) else { return nil }
guard let targetCenter = target.getCenter() else { return nil }
guard let tilingParent = target.parent as? TilingContainer else { return nil }
Expand Down
7 changes: 1 addition & 6 deletions src/tree/WorkspaceEx.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ extension Workspace {
func layoutWorkspace() {
if isEffectivelyEmpty { return }
let rect = monitor.visibleRectPaddedByOuterGaps
layoutRecursive(
rect.topLeftCorner,
width: rect.width,
height: rect.height,
virtual: rect
)
layoutRecursive(rect.topLeftCorner, width: rect.width, height: rect.height, virtual: rect)
}
}
2 changes: 1 addition & 1 deletion src/tree/layoutRecursive.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extension TreeNode {
case .window(let window):
if window.windowId != currentlyManipulatedWithMouseWindowId {
lastAppliedLayoutVirtualRect = virtual
if window.isFullscreen && window == focusedWindow {
if window.isFullscreen && window == workspace.mostRecentWindow {
lastAppliedLayoutPhysicalRect = nil
let monitorRect = window.workspace.monitor.visibleRectPaddedByOuterGaps
window.setTopLeftCorner(monitorRect.topLeftCorner)
Expand Down

0 comments on commit 4782a05

Please sign in to comment.