diff --git a/src/logic/Preferences.swift b/src/logic/Preferences.swift index d12b90e1..c71bde7b 100644 --- a/src/logic/Preferences.swift +++ b/src/logic/Preferences.swift @@ -64,6 +64,9 @@ class Preferences { "hideThumbnails": "false", ] + // system preferences + static var finderShowsQuitMenuItem: Bool { UserDefaults(suiteName: "com.apple.Finder")?.bool(forKey: "QuitMenuItem") ?? false } + // constant values // not exposed as preferences now but may be in the future, probably through macro preferences static var windowMaterial: NSVisualEffectView.Material { .dark } diff --git a/src/logic/Window.swift b/src/logic/Window.swift index 39e9e92e..2b173515 100644 --- a/src/logic/Window.swift +++ b/src/logic/Window.swift @@ -128,7 +128,7 @@ class Window { func quitApp() { // prevent users from quitting Finder - if application.runningApplication.bundleIdentifier == "com.apple.finder" { return } + if application.runningApplication.bundleIdentifier == "com.apple.finder" && !Preferences.finderShowsQuitMenuItem { return } BackgroundWork.accessibilityCommandsQueue.asyncWithCap { [weak self] in self?.application.runningApplication.terminate() }