Add bell feature flags for audio, attention, and title actions on macOS (#7533)
Resolve #7526pull/7537/head
commit
269d29624b
|
|
@ -537,12 +537,14 @@ class AppDelegate: NSObject,
|
|||
}
|
||||
|
||||
@objc private func ghosttyBellDidRing(_ notification: Notification) {
|
||||
if (ghostty.config.bellFeatures.contains(.attention)) {
|
||||
// Bounce the dock icon if we're not focused.
|
||||
NSApp.requestUserAttention(.informationalRequest)
|
||||
|
||||
// Handle setting the dock badge based on permissions
|
||||
ghosttyUpdateBadgeForBell()
|
||||
}
|
||||
}
|
||||
|
||||
private func ghosttyUpdateBadgeForBell() {
|
||||
let center = UNUserNotificationCenter.current()
|
||||
|
|
|
|||
|
|
@ -566,6 +566,9 @@ extension Ghostty.Config {
|
|||
let rawValue: CUnsignedInt
|
||||
|
||||
static let system = BellFeatures(rawValue: 1 << 0)
|
||||
static let audio = BellFeatures(rawValue: 1 << 1)
|
||||
static let attention = BellFeatures(rawValue: 1 << 2)
|
||||
static let title = BellFeatures(rawValue: 1 << 3)
|
||||
}
|
||||
|
||||
enum MacHidden : String {
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ extension Ghostty {
|
|||
|
||||
var title: String {
|
||||
var result = surfaceView.title
|
||||
if (surfaceView.bell) {
|
||||
if (surfaceView.bell && ghostty.config.bellFeatures.contains(.title)) {
|
||||
result = "🔔 \(result)"
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue