From a41ee3cabec95ae4d52163f8e0c365abd2d0a3f8 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 27 Jan 2024 09:58:02 -0800 Subject: [PATCH] macos: make global macOS fullscreen keybind work Fixes #1389 This is just a fun AppKit quirk. This menu item is set automatically based on the keyboard shortcut (apparently) and when its overwritten then its gone forever. So, let's just not set it. --- macos/Sources/App/macOS/AppDelegate.swift | 7 ++++++- macos/Sources/App/macOS/MainMenu.xib | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/macos/Sources/App/macOS/AppDelegate.swift b/macos/Sources/App/macOS/AppDelegate.swift index d3d3e1f4b..22ab223dc 100644 --- a/macos/Sources/App/macOS/AppDelegate.swift +++ b/macos/Sources/App/macOS/AppDelegate.swift @@ -264,7 +264,6 @@ class AppDelegate: NSObject, syncMenuShortcut(action: "paste_from_clipboard", menuItem: self.menuPaste) syncMenuShortcut(action: "select_all", menuItem: self.menuSelectAll) - syncMenuShortcut(action: "toggle_fullscreen", menuItem: self.menuToggleFullScreen) syncMenuShortcut(action: "toggle_split_zoom", menuItem: self.menuZoomSplit) syncMenuShortcut(action: "goto_split:previous", menuItem: self.menuPreviousSplit) syncMenuShortcut(action: "goto_split:next", menuItem: self.menuNextSplit) @@ -282,6 +281,12 @@ class AppDelegate: NSObject, syncMenuShortcut(action: "decrease_font_size:1", menuItem: self.menuDecreaseFontSize) syncMenuShortcut(action: "reset_font_size", menuItem: self.menuResetFontSize) syncMenuShortcut(action: "inspector:toggle", menuItem: self.menuTerminalInspector) + + // This menu item is NOT synced with the configuration because it disables macOS + // global fullscreen keyboard shortcut. The shortcut in the Ghostty config will continue + // to work but it won't be reflected in the menu item. + // + // syncMenuShortcut(action: "toggle_fullscreen", menuItem: self.menuToggleFullScreen) // Dock menu reloadDockMenu() diff --git a/macos/Sources/App/macOS/MainMenu.xib b/macos/Sources/App/macOS/MainMenu.xib index ca9cd1f35..cd627f762 100644 --- a/macos/Sources/App/macOS/MainMenu.xib +++ b/macos/Sources/App/macOS/MainMenu.xib @@ -234,8 +234,8 @@ - - + +