Skip to content

Commit

Permalink
feature: added option cross-workspace-floating-windows to allow flo…
Browse files Browse the repository at this point in the history
…ating windows to exist across workspaces
  • Loading branch information
Navonil Majumder authored and Navonil Majumder committed Nov 10, 2024
1 parent 00cbb63 commit 1229230
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions Sources/AppBundle/config/Config.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Sources/AppBundle/config/parseConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ private let configParser: [String: any ParserProtocol<Config>] = [

"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),
Expand Down
8 changes: 7 additions & 1 deletion Sources/AppBundle/normalizeLayoutReason.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 1229230

Please sign in to comment.