diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 1f5254cc..477ee996 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,7 +1,7 @@ ## PR checklist - [ ] Explain your changes in the relevant commit messages rather than in the PR description. The PR description must not contain more information than the commit messages (except for images and other media). -- [ ] Each commit must explain what/why/how in its description. https://cbea.ms/git-commit/ +- [ ] Each commit must explain what/why/how and motivation in its description. https://cbea.ms/git-commit/ - [ ] Don't forget to link the appropriate issues/discussions in commit messages (if applicable). - [ ] Each commit must be an atomic change (a PR may contain several commits). Don't introduce new functional changes together with refactorings in the same commit. - [ ] The GitHub Actions CI must pass (you can fix failures after submitting a PR). diff --git a/Sources/AeroSpaceApp/AeroSpaceApp.swift b/Sources/AeroSpaceApp/AeroSpaceApp.swift index 4fc96cf2..960a943e 100644 --- a/Sources/AeroSpaceApp/AeroSpaceApp.swift +++ b/Sources/AeroSpaceApp/AeroSpaceApp.swift @@ -7,7 +7,7 @@ import SwiftUI struct AeroSpaceApp: App { @StateObject var viewModel = TrayMenuModel.shared @StateObject var messageModel = MessageModel.shared - @Environment(\.openWindow) var openWindow + @Environment(\.openWindow) var openWindow: OpenWindowAction init() { initAppBundle() diff --git a/Sources/AppBundle/command/impl/JoinWithCommand.swift b/Sources/AppBundle/command/impl/JoinWithCommand.swift index 1cd347cc..fe608dfd 100644 --- a/Sources/AppBundle/command/impl/JoinWithCommand.swift +++ b/Sources/AppBundle/command/impl/JoinWithCommand.swift @@ -12,7 +12,7 @@ struct JoinWithCommand: Command { return io.err(noWindowIsFocused) } guard let (parent, ownIndex) = currentWindow.closestParent(hasChildrenInDirection: direction, withLayout: nil) else { - return io.err("No windows in specified direction") + return io.err("No windows in the specified direction") } let joinWithTarget = parent.children[ownIndex + direction.focusOffset] let prevBinding = joinWithTarget.unbindFromParent() diff --git a/Sources/AppBundle/tree/TreeNodeEx.swift b/Sources/AppBundle/tree/TreeNodeEx.swift index 5f804812..98b37af7 100644 --- a/Sources/AppBundle/tree/TreeNodeEx.swift +++ b/Sources/AppBundle/tree/TreeNodeEx.swift @@ -78,7 +78,7 @@ extension TreeNode { set { setWeight(.v, newValue) } } - /// Returns closest parent that has children in specified direction relative to `self` + /// Returns closest parent that has children in the specified direction relative to `self` func closestParent( hasChildrenInDirection direction: CardinalDirection, withLayout layout: Layout?, diff --git a/Sources/AppBundle/ui/MessageView.swift b/Sources/AppBundle/ui/MessageView.swift index e47d3751..78b998d5 100644 --- a/Sources/AppBundle/ui/MessageView.swift +++ b/Sources/AppBundle/ui/MessageView.swift @@ -26,7 +26,7 @@ public let messageWindowId = "\(aeroSpaceAppName).messageView" public struct MessageView: View { @StateObject private var model: MessageModel - @Environment(\.dismiss) private var dismiss + @Environment(\.dismiss) private var dismiss: DismissAction @FocusState var focus: Bool public init(model: MessageModel) { @@ -58,6 +58,7 @@ public struct MessageView: View { TextEditor(text: cancelOnEnterBinding) .font(.system(size: 12).monospaced()) .focused($focus) + // .onKeyPress(.return) { return .handled } // enter handling alternative. Only available since macOS 14 Spacer() } Spacer() diff --git a/Sources/AppBundle/ui/SecureInputView.swift b/Sources/AppBundle/ui/SecureInputView.swift index bb4f7432..d770c1e7 100644 --- a/Sources/AppBundle/ui/SecureInputView.swift +++ b/Sources/AppBundle/ui/SecureInputView.swift @@ -15,20 +15,23 @@ public class SecureInputPanel: NSPanelHud { @MainActor public func refresh() { - if isVisible && !TrayMenuModel.shared.isEnabled { - close() - } else if IsSecureEventInputEnabled() { - if isVisible { return } - self.contentView?.subviews.removeAll() - hostingView = NSHostingView(rootView: SecureInputView()) - hostingView.frame = NSRect(x: 0, y: 0, width: iconSize.width, height: iconSize.height) - self.contentView?.addSubview(hostingView) - let x = mainMonitor.width - iconSize.width - 20 - let panelFrame = NSRect(x: x, y: 20, width: iconSize.width, height: iconSize.width) - self.setFrame(panelFrame, display: true) - self.orderFrontRegardless() - } else { - if isVisible { close() } + lazy var isSecureInputEnabled = IsSecureEventInputEnabled() + switch true { + case isVisible && !TrayMenuModel.shared.isEnabled: + close() + case isSecureInputEnabled == isVisible: + break + case isSecureInputEnabled: + self.contentView?.subviews.removeAll() + hostingView = NSHostingView(rootView: SecureInputView()) + hostingView.frame = NSRect(x: 0, y: 0, width: iconSize.width, height: iconSize.height) + self.contentView?.addSubview(hostingView) + let x = mainMonitor.width - iconSize.width - 20 + let panelFrame = NSRect(x: x, y: 20, width: iconSize.width, height: iconSize.width) + self.setFrame(panelFrame, display: true) + self.orderFrontRegardless() + default: + close() } } diff --git a/Sources/Common/cmdArgs/impl/CloseAllWindowsButCurrentCmdArgs.swift b/Sources/Common/cmdArgs/impl/CloseAllWindowsButCurrentCmdArgs.swift index f620d99c..07b05f38 100644 --- a/Sources/Common/cmdArgs/impl/CloseAllWindowsButCurrentCmdArgs.swift +++ b/Sources/Common/cmdArgs/impl/CloseAllWindowsButCurrentCmdArgs.swift @@ -17,5 +17,5 @@ public struct CloseAllWindowsButCurrentCmdArgs: CmdArgs { } public func parseCloseAllWindowsButCurrentCmdArgs(_ args: [String]) -> ParsedCmd { - parseSpecificCmdArgs(CloseAllWindowsButCurrentCmdArgs(rawArgs: .init(args)), args) + parseSpecificCmdArgs(CloseAllWindowsButCurrentCmdArgs(rawArgs: args), args) } diff --git a/Sources/Common/cmdArgs/impl/MoveNodeToWorkspaceCmdArgs.swift b/Sources/Common/cmdArgs/impl/MoveNodeToWorkspaceCmdArgs.swift index ae5fe31f..ede46ca6 100644 --- a/Sources/Common/cmdArgs/impl/MoveNodeToWorkspaceCmdArgs.swift +++ b/Sources/Common/cmdArgs/impl/MoveNodeToWorkspaceCmdArgs.swift @@ -40,7 +40,7 @@ extension MoveNodeToWorkspaceCmdArgs { func implication(ifTrue: Bool, mustHold: @autoclosure () -> Bool) -> Bool { !ifTrue || mustHold() } public func parseMoveNodeToWorkspaceCmdArgs(_ args: [String]) -> ParsedCmd { - parseSpecificCmdArgs(MoveNodeToWorkspaceCmdArgs(rawArgs: .init(args)), args) + parseSpecificCmdArgs(MoveNodeToWorkspaceCmdArgs(rawArgs: args), args) .filter("--wrapAround requires using (prev|next) argument") { ($0._wrapAround != nil).implies($0.target.val.isRelatve) } .filterNot("--fail-if-noop is incompatible with (next|prev)") { $0.failIfNoop && $0.target.val.isRelatve } .filterNot("--window-id is incompatible with (next|prev)") { $0.windowId != nil && $0.target.val.isRelatve } diff --git a/docs/aerospace-focus.adoc b/docs/aerospace-focus.adoc index 02e48eef..f1ef66df 100644 --- a/docs/aerospace-focus.adoc +++ b/docs/aerospace-focus.adoc @@ -47,7 +47,7 @@ The default is: `workspace` --boundaries-action :: Defines the behavior when requested to cross the ``. + -`` possible values: `(stop|fail|wrap-around-the-workspace|wrap-around-all-monitors)` + +`` possible values: `(stop|fail|wrap-around-the-workspace|wrap-around-all-monitors)`. + The default is: `stop` --window-id :: diff --git a/docs/aerospace-list-monitors.adoc b/docs/aerospace-list-monitors.adoc index 5fe3d301..d9d4d0b1 100644 --- a/docs/aerospace-list-monitors.adoc +++ b/docs/aerospace-list-monitors.adoc @@ -32,13 +32,17 @@ Filter results to only print the focused monitor. Filter results to only print the monitor with the mouse. `[no]` inverts the condition ---format :: Specify output format. See "Output Format" section for more details. +--format :: +Specify output format. +See "Output Format" section for more details. Incompatible with `--count` ---count:: Output only the number of workspaces. +--count:: +Output only the number of workspaces. Incompatible with `--format` ---json:: Output in JSON format. +--json:: +Output in JSON format. Can be used in combination with `--format` to specify which data to include into the json. Incompatible with `--count` diff --git a/docs/aerospace-list-workspaces.adoc b/docs/aerospace-list-workspaces.adoc index e77fe477..3c27d50d 100644 --- a/docs/aerospace-list-workspaces.adoc +++ b/docs/aerospace-list-workspaces.adoc @@ -44,13 +44,17 @@ Several workspaces can be visible in multi-monitor setup Filter results to only print empty workspaces. `[no]` inverts the condition. ---format :: Specify output format. See "Output Format" section for more details. +--format :: +Specify output format. +See "Output Format" section for more details. Incompatible with `--count` ---count:: Output only the number of workspaces. +--count:: +Output only the number of workspaces. Incompatible with `--format` ---json:: Output in JSON format. +--json:: +Output in JSON format. Can be used in combination with `--format` to specify which data to include into the json. Incompatible with `--count` diff --git a/docs/aerospace-swap.adoc b/docs/aerospace-swap.adoc index 0f69de62..3bb30710 100644 --- a/docs/aerospace-swap.adoc +++ b/docs/aerospace-swap.adoc @@ -21,6 +21,8 @@ aerospace swap [-h|--help] [--window-id ] [--swap-focus] // tag::body[] {manpurpose} +The operation is equivalent to dragging a window with the mouse. + // =========================================================== Options include::util/conditional-options-header.adoc[] @@ -30,7 +32,8 @@ include::util/conditional-options-header.adoc[] include::./util/window-id-flag-desc.adoc[] --swap-focus:: -Swap focus away from the currently focused window. By default, this command does not change the focused window. +Swap focus away from the currently focused window. +By default, this command does not change the focused window. --wrap-around:: Wrap around if the window is at the edge of the workspace (for `(left|down|up|right)`) or the start/end of the depth first order (for `(dfs-next|dfs-prev)`). diff --git a/docs/aerospace-workspace.adoc b/docs/aerospace-workspace.adoc index c4f85b60..7da76b51 100644 --- a/docs/aerospace-workspace.adoc +++ b/docs/aerospace-workspace.adoc @@ -40,7 +40,7 @@ Automatic `back-and-forth` when switching to already focused workspace. Incompatible with `--fail-if-noop` --fail-if-noop:: -Exit with non-zero exit code if switch to the already focused workspace +Exit with non-zero exit code if switch to the already focused workspace. Incompatible with `--auto-back-and-forth` --stdin::