mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-08-29 02:21:43 +00:00
Add setting to hide icon from dock/cmd-tab
This commit is contained in:
committed by
Mitchell Hashimoto
parent
aeccbd266a
commit
d7a82f212a
@@ -533,6 +533,15 @@ class AppDelegate: NSObject,
|
||||
// AppKit mutex on the appearance.
|
||||
DispatchQueue.main.async { self.syncAppearance(config: config) }
|
||||
|
||||
// Decide whether to hide/unhide app from dock and app switcher
|
||||
switch (config.macosHidden) {
|
||||
case .never:
|
||||
NSApp.setActivationPolicy(.regular)
|
||||
|
||||
case .always:
|
||||
NSApp.setActivationPolicy(.accessory)
|
||||
}
|
||||
|
||||
// If we have configuration errors, we need to show them.
|
||||
let c = ConfigurationErrorsController.sharedInstance
|
||||
c.errors = config.errors
|
||||
|
||||
@@ -302,6 +302,16 @@ extension Ghostty {
|
||||
return buffer.map { .init(ghostty: $0) }
|
||||
}
|
||||
|
||||
var macosHidden: MacHidden {
|
||||
guard let config = self.config else { return .never }
|
||||
var v: UnsafePointer<Int8>? = nil
|
||||
let key = "macos-hidden"
|
||||
guard ghostty_config_get(config, &v, key, UInt(key.count)) else { return .never }
|
||||
guard let ptr = v else { return .never }
|
||||
let str = String(cString: ptr)
|
||||
return MacHidden(rawValue: str) ?? .never
|
||||
}
|
||||
|
||||
var focusFollowsMouse : Bool {
|
||||
guard let config = self.config else { return false }
|
||||
var v = false;
|
||||
@@ -516,6 +526,11 @@ extension Ghostty.Config {
|
||||
case download
|
||||
}
|
||||
|
||||
enum MacHidden : String {
|
||||
case never
|
||||
case always
|
||||
}
|
||||
|
||||
enum ResizeOverlay : String {
|
||||
case always
|
||||
case never
|
||||
|
||||
Reference in New Issue
Block a user