diff --git a/Sources/Views/MenuBar/BugListPopover.swift b/Sources/Views/MenuBar/BugListPopover.swift index 2e44ac4..00006cb 100644 --- a/Sources/Views/MenuBar/BugListPopover.swift +++ b/Sources/Views/MenuBar/BugListPopover.swift @@ -4,6 +4,7 @@ import SwiftUI struct BugListPopover: View { @State private var bugStore = BugStore.shared @State private var tokenManager = TokenManager.shared + @Environment(\.openSettings) private var openSettings var body: some View { VStack(spacing: 0) { @@ -90,7 +91,16 @@ struct BugListPopover: View { Button("Refresh") { Task { await PollerService.shared.fetchNow() } } - SettingsLink { + Button { + openSettings() + // Bugger runs as an accessory (no Dock icon), so the Settings + // window would otherwise open behind whatever is frontmost. + // Activate on the next runloop pass, once the window exists, + // to bring it on top. + DispatchQueue.main.async { + NSRunningApplication.current.activate(options: [.activateAllWindows]) + } + } label: { Label("Settings", systemImage: "gear") } Button(action: { NSApp.terminate(nil) }) {