Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Coder-Desktop/Coder-Desktop/Coder_DesktopApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -198,5 +198,5 @@ extension AppDelegate {

@MainActor
func appActivate() {
NSApp.activate()
NSApp.activate(ignoringOtherApps: true)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep appActivate from stealing focus in background callbacks

Switching appActivate() to NSApp.activate(ignoringOtherApps: true) changes behavior for every caller, not only the Settings button. UpdaterService.updater(_:didFindValidUpdate:) invokes appActivate() when automatic update checks find a release, so this commit now forces the app to the foreground even if the user is actively working in another application. That makes background update discovery interruptive and is a regression in user experience outside the Settings flow.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly I'm a fan of this, I think that if we're opening a window it makes genuine sense being the only way to access this is from the menubar.

Thoughts?

}
2 changes: 2 additions & 0 deletions Coder-Desktop/Coder-Desktop/Views/VPN/VPNMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ struct VPNMenu<VPN: VPNService, FS: FileSyncDaemon>: View {
}
AuthButton<VPN>()
Button {
NSApp.setActivationPolicy(.regular)
openSettings()
appActivate()
NSApp.arrangeInFront(nil)
} label: {
ButtonRowView { Text("Settings") }
}.buttonStyle(.plain)
Expand Down
Loading