Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix for menu on macOS systems
  • Loading branch information
alblue committed Jan 17, 2021
1 parent b4e9434 commit def736d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions MinimalBug/main.swift
Expand Up @@ -3,8 +3,15 @@
// to another application and back again
import AppKit

@objc
class Delegate: NSObject, NSApplicationDelegate {
func applicationDidFinishLaunching(_ notification: Notification) {
app.activate(ignoringOtherApps: true)
}
}

var app = NSApplication.shared
app.setActivationPolicy(.regular)

app.activate(ignoringOtherApps: true)
let delegate = Delegate()
app.delegate = delegate
app.run()

0 comments on commit def736d

Please sign in to comment.