mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-06-22 07:18:45 +03:00
Spawn alert box on new tab if decorations disabled
Stray spaces Fix check for windowDecoration
This commit is contained in:

committed by
Mitchell Hashimoto

parent
2b380ad37e
commit
833be445ba
@ -385,6 +385,16 @@ extension Ghostty {
|
|||||||
static func newTab(_ userdata: UnsafeMutableRawPointer?, config: ghostty_surface_config_s) {
|
static func newTab(_ userdata: UnsafeMutableRawPointer?, config: ghostty_surface_config_s) {
|
||||||
guard let surface = self.surfaceUserdata(from: userdata) else { return }
|
guard let surface = self.surfaceUserdata(from: userdata) else { return }
|
||||||
|
|
||||||
|
guard self.appState(fromSurface: userdata)?.windowDecorations else {
|
||||||
|
let alert = NSAlert()
|
||||||
|
alert.messageText = "Tabs are disabled"
|
||||||
|
alert.informativeText = "Enable window decorations to use tabs"
|
||||||
|
alert.addButton(withTitle: "OK")
|
||||||
|
alert.alertStyle = .warning
|
||||||
|
_ = alert.runModal()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
NotificationCenter.default.post(
|
NotificationCenter.default.post(
|
||||||
name: Notification.ghosttyNewTab,
|
name: Notification.ghosttyNewTab,
|
||||||
object: surface,
|
object: surface,
|
||||||
|
Reference in New Issue
Block a user