diff --git a/Sources/AppBundle/config/Config.swift b/Sources/AppBundle/config/Config.swift index 2c0aad91..a79d2b07 100644 --- a/Sources/AppBundle/config/Config.swift +++ b/Sources/AppBundle/config/Config.swift @@ -40,6 +40,7 @@ struct Config: Copyable { var defaultRootContainerOrientation: DefaultContainerOrientation = .auto var startAtLogin: Bool = false var automaticallyUnhideMacosHiddenApps: Bool = false + var crossWorkspaceFloatingWindows: Bool = false var accordionPadding: Int = 30 var enableNormalizationOppositeOrientationForNestedContainers: Bool = true var execOnWorkspaceChange: [String] = [] // todo deprecate diff --git a/Sources/AppBundle/config/parseConfig.swift b/Sources/AppBundle/config/parseConfig.swift index bca2b5d6..d253b171 100644 --- a/Sources/AppBundle/config/parseConfig.swift +++ b/Sources/AppBundle/config/parseConfig.swift @@ -102,6 +102,7 @@ private let configParser: [String: any ParserProtocol] = [ "start-at-login": Parser(\.startAtLogin, parseBool), "automatically-unhide-macos-hidden-apps": Parser(\.automaticallyUnhideMacosHiddenApps, parseBool), + "cross-workspace-floating-windows": Parser(\.crossWorkspaceFloatingWindows, parseBool), "accordion-padding": Parser(\.accordionPadding, parseInt), "exec-on-workspace-change": Parser(\.execOnWorkspaceChange, parseExecOnWorkspaceChange), "exec": Parser(\.execConfig, parseExecConfig), diff --git a/Sources/AppBundle/normalizeLayoutReason.swift b/Sources/AppBundle/normalizeLayoutReason.swift index fef0520f..16fb6f78 100644 --- a/Sources/AppBundle/normalizeLayoutReason.swift +++ b/Sources/AppBundle/normalizeLayoutReason.swift @@ -33,7 +33,13 @@ private func _normalizeLayoutReason(workspace: Workspace, windows: [Window]) { window.bind(to: macosMinimizedWindowsContainer, adaptiveWeight: 1, index: INDEX_BIND_LAST) } else if isMacosWindowOfHiddenApp { window.layoutReason = .macos(prevParentKind: window.parent.kind) - window.bind(to: workspace.macOsNativeHiddenAppsWindowsContainer, adaptiveWeight: 1, index: INDEX_BIND_LAST) + if !config.crossWorkspaceFloatingWindows || window.parent.kind != .workspace { + window.bind(to: workspace.macOsNativeHiddenAppsWindowsContainer, adaptiveWeight: 1, index: INDEX_BIND_LAST) + } else { + window.bind(to: macosMinimizedWindowsContainer, adaptiveWeight: 1, index: INDEX_BIND_LAST) + } + } else if config.crossWorkspaceFloatingWindows && window.parent.kind == .workspace { + window.bindAsFloatingWindow(to: focus.workspace) } case .macos(let prevParentKind): if !isMacosFullscreen && !isMacosMinimized && !isMacosWindowOfHiddenApp {