mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
macos: persist secure input state across restarts
This commit is contained in:
@ -106,6 +106,11 @@ class AppDelegate: NSObject,
|
|||||||
"ApplePressAndHoldEnabled": false,
|
"ApplePressAndHoldEnabled": false,
|
||||||
])
|
])
|
||||||
|
|
||||||
|
// Check if secure input was enabled when we last quit.
|
||||||
|
if (UserDefaults.standard.bool(forKey: "SecureInput") != SecureInput.shared.enabled) {
|
||||||
|
toggleSecureInput(self)
|
||||||
|
}
|
||||||
|
|
||||||
// Hook up updater menu
|
// Hook up updater menu
|
||||||
menuCheckForUpdates?.target = updaterController
|
menuCheckForUpdates?.target = updaterController
|
||||||
menuCheckForUpdates?.action = #selector(SPUStandardUpdaterController.checkForUpdates(_:))
|
menuCheckForUpdates?.action = #selector(SPUStandardUpdaterController.checkForUpdates(_:))
|
||||||
@ -492,5 +497,6 @@ class AppDelegate: NSObject,
|
|||||||
let input = SecureInput.shared
|
let input = SecureInput.shared
|
||||||
input.global.toggle()
|
input.global.toggle()
|
||||||
self.menuSecureInput?.state = if (input.global) { .on } else { .off }
|
self.menuSecureInput?.state = if (input.global) { .on } else { .off }
|
||||||
|
UserDefaults.standard.set(input.global, forKey: "SecureInput")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user