summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
Diffstat (limited to 'video')
-rw-r--r--video/out/mac/common.swift19
1 files changed, 18 insertions, 1 deletions
diff --git a/video/out/mac/common.swift b/video/out/mac/common.swift
index 4b5e1265c0..fb52b80610 100644
--- a/video/out/mac/common.swift
+++ b/video/out/mac/common.swift
@@ -61,7 +61,24 @@ class Common: NSObject {
}
func initApp() {
- NSApp.setActivationPolicy(.regular)
+ guard let mpv = mpv else {
+ log.sendError("Something went wrong, no MPVHelper was initialized")
+ exit(1)
+ }
+
+ var policy: NSApplication.ActivationPolicy = .regular
+ switch mpv.macOpts.macos_app_activation_policy {
+ case 0:
+ policy = .regular
+ case 1:
+ policy = .accessory
+ case 2:
+ policy = .prohibited
+ default:
+ break
+ }
+
+ NSApp.setActivationPolicy(policy)
setAppIcon()
}