Skip to content

Commit 17cf0e9

Browse files
committed
Make Popover behavior transient
1 parent 9190096 commit 17cf0e9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

TouchMemes/AppDelegate.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ class AppDelegate: NSObject, NSApplicationDelegate
3838
button.image = NSImage(named: NSImage.Name(rawValue: "MenuBarIcon"))
3939
button.action = #selector(togglePopover)
4040
}
41+
42+
popover.behavior = .transient
4143
popover.contentViewController = PreferencesViewController.freshController()
4244
popover.appearance = NSAppearance(named: .aqua)
4345
}
@@ -51,6 +53,7 @@ class AppDelegate: NSObject, NSApplicationDelegate
5153
}
5254

5355
func showPopover(sender: Any?) {
56+
NSApplication.shared.activate(ignoringOtherApps: true)
5457
if let button = statusItem.button {
5558
popover.show(relativeTo: button.bounds, of: button, preferredEdge: NSRectEdge.minY)
5659
}

0 commit comments

Comments
 (0)