49 Commits

Author SHA1 Message Date
Mitchell Hashimoto
df7120d130 macos: use notification to detect when quick terminal shows/hides
Fixes #2474
2024-10-23 10:14:11 -07:00
Mitchell Hashimoto
ed2cd6d436 macos: remove the ability to bind fn/globe
This was recently introduced a few days ago. Unfortunately, this doesn't
work as expected. The "function" modifier is not actually the fn key
but used by macOS to represent a variety of "functional" key presses.
This breaks other bindings such as #2411.

I can't find a source on the internet that reliably tells me how we
can detect fn key presses, but I do find a number of sources that tell
us we can't.
2024-10-07 14:36:12 -10:00
Mitchell Hashimoto
f9e6d6efa6 macos: forward key events to the app when no windows exist 2024-10-05 10:05:06 -10:00
Mitchell Hashimoto
6fdfa9d491 Make the function/globe key available as a modifier on macOS 2024-10-05 09:39:55 -10:00
Mitchell Hashimoto
9971d7a93d macos: toggle_visibility needs to sync to the correct menu item 2024-10-05 06:05:13 -10:00
Mitchell Hashimoto
c973ca6e03 macos: move show/hide all terminal windows
I don't think "View" was the right place.

Also, the menu was incorrectly bound to the quick terminal variable.
2024-10-04 06:35:20 -10:00
Lucy Davinhart
a109b8d755 Implements initial-window=false for macOS
Closes https://github.com/ghostty-org/ghostty/issues/2361
2024-10-03 19:09:37 +01:00
Mitchell Hashimoto
28ec11e52b docs updates 2024-10-02 10:52:59 -07:00
Roland Peelen
af48c1af0c Refactor to hide only BaseTerminalController windows
This also slightly changes the code, as the duplication of the for loop
was making it harder to read now. I think technically slightly less
efficient, but this is hardly a hot code path, so should be fine imo.
2024-10-02 10:33:36 -07:00
Roland Peelen
4aac4ecd98 Add hiding toggle, hook up to menu / shortcut 2024-10-02 10:33:36 -07:00
Mitchell Hashimoto
11d5ec7dc1 config: support quick terminal position 2024-09-28 18:42:25 -07:00
Mitchell Hashimoto
13eb8ac6e2 macos: ability to interrupt animation, track it in menu 2024-09-28 15:29:57 -07:00
Mitchell Hashimoto
1570ef01a7 rename slide to quick terminal 2024-09-28 15:20:35 -07:00
Mitchell Hashimoto
cadb960ef9 core: slide terminal keybinding action 2024-09-27 18:36:06 -07:00
Mitchell Hashimoto
bdd0070ffd macos: render a terminal in the slide window 2024-09-27 18:36:06 -07:00
Mitchell Hashimoto
93b2fe60f8 macos: start work on SlideTerminal, slides in window from top 2024-09-27 18:36:06 -07:00
Mitchell Hashimoto
4ae20212bf libghostty: unified action dispatch
First, this commit modifies libghostty to use a single unified action
dispatch system based on a tagged union versus the one-off callback
system that was previously in place. This change simplifies the code on
both the core and consumer sides of the library. Importantly, as we
introduce new actions, we can now maintain ABI compatibility so long as
our union size does not change (something I don't promise yet).

Second, this moves a lot more of the functions call on a surface into
the action system. This affects all apprts and continues the previous
work of introducing a more unified API for optional surface features.
2024-09-26 22:00:11 -07:00
Mitchell Hashimoto
6d6052d204 small comment changes 2024-09-24 20:53:45 -07:00
Mitchell Hashimoto
ed7ac8aa21 macos: better enable timing depending on process launch time 2024-09-24 16:38:17 -07:00
Mitchell Hashimoto
1ad904478d Tap events, core API to handle global keybinds 2024-09-24 16:29:02 -07:00
Mitchell Hashimoto
fa9df4f6f0 macos: persist secure input state across restarts 2024-09-19 19:54:53 -07:00
Mitchell Hashimoto
c0e0eff468 core: add toggle_secure_input keybinding 2024-09-19 10:20:30 -07:00
Mitchell Hashimoto
0c38f40f0a macos: secure input manager, global option in app 2024-09-19 10:11:31 -07:00
Mitchell Hashimoto
bcfe7d0f6c macos: update comment on why we don't start updater 2024-09-10 21:55:58 -07:00
Mitchell Hashimoto
359272a5f5 macos: start Sparkle after loading config 2024-09-10 21:54:40 -07:00
hanna
fd9d38481b refactor: attempted autoupdate configuration 2024-09-10 21:40:17 -07:00
Mitchell Hashimoto
90d21a6a65 macos: do not open a window on reopen if terminal manager has any
Fixes #2135. See the comment on how this is possible.
2024-08-22 19:58:41 -07:00
pnodet
7ff9af1520 style(macos): cleanup trailing spaces 2024-08-21 21:53:09 +02:00
Jon Parise
2a66d37e48 Update functional URLs for ghostty-org 2024-06-01 16:44:09 -04:00
cryptocode
a304c953bf Rename menu item variable name accordingly 2024-05-10 12:08:19 +02:00
cryptocode
2faa0c9bee Rename Split Horizontally/Vertically to Split Right/Down
I make the following suggestion through a PR since I already tried this locally and have a branch ready:

- Rename Split Horizontally to Split Right
- Rename Split Vertically to Split Down

Rationale:

The terms horizontal and vertical are ambiguous in the context of splitting (does it mean the splitter is vertical, or are the panes organized vertically?)
Different apps pick different interpretations, so people get confused.

IntelliJ made the same change as above based on user feedback: https://youtrack.jetbrains.com/issue/IJPL-130991/Split-Vertically-and-Split-Horizontally-are-ambiguous-and-should-be-renamed

Ghostty is using the left/right nomenclature in other menu items. In the codebase, SplitDirection is already left/right.
2024-05-10 11:17:11 +02:00
Mitchell Hashimoto
dd0ec492e4 macos: wrap syncAppearance in async call
Fixes #1656

When called as part of window restoration AppKit has a lock, so
NSAppearance changes need to be called async.

See deadlock:

```
Thread 1 Queue : com.apple.main-thread (serial)
0	0x000000018fd63fac in __ulock_wait ()
1	0x00000001069bf720 in _dlock_wait ()
2	0x00000001069bfaec in _dispatch_group_wait_slow ()
3	0x0000000106b5f5c4 in interposed_dispatch_group_wait ()
4	0x00000001937fb1f0 in NSCGSTransactionRunPreCommitActions_ ()
5	0x00000001938f1230 in -[_NSCGSTransaction synchronize] ()
6	0x00000001938f11ac in NSCGSTransactionSynchronize ()
7	0x000000019382ad30 in +[NSCGSWindow(NSCGSSpace) isAnyWindowOnAVisibleSpace:] ()
8	0x000000019382a968 in -[NSWindow _isInSomeVisibleSpace] ()
9	0x000000019382a8e4 in -[NSWindow isOnActiveSpace] ()
10	0x0000000193db8d98 in -[NSApplication(NSApplicationAppearance_Internal) _invalidateWindowAppearances] ()
11	0x00000001938f44d4 in -[NSApplication(NSAppearanceCustomization) setAppearance:] ()
12	0x0000000102c48050 in AppDelegate.syncAppearance() at /Users/mitchellh/code/go/src/github.com/mitchellh/ghostty/macos/Sources/App/macOS/AppDelegate.swift:412
13	0x0000000102c47840 in AppDelegate.configDidReload(_:) at /Users/mitchellh/code/go/src/github.com/mitchellh/ghostty/macos/Sources/App/macOS/AppDelegate.swift:380
14	0x0000000102c43c7c in AppDelegate.applicationDidFinishLaunching(_:) at /Users/mitchellh/code/go/src/github.com/mitchellh/ghostty/macos/Sources/App/macOS/AppDelegate.swift:110
```
2024-04-05 10:01:44 -07:00
Pete Schaffner
3b6bac0121 Make special blending mode class more generic
This allows us to specify what kind of context we'd like our vibrant
layer to exist in (light or dark).
2024-02-11 00:53:18 +01:00
Mitchell Hashimoto
0e482b8519 macos: nitpicks 2024-02-10 07:52:02 -08:00
Pete Schaffner
77e82b4d2a Improve window buttons backdrop with window opacity 2024-02-09 22:46:49 +01:00
Pete Schaffner
8831c601a4 Use draw rect to do the "plus darker" blending
This is a lot simpler and doesn't require adding Obj-C into the mix.
2024-02-08 16:38:07 +01:00
Pete Schaffner
40cfa1abd4 Add CALayer subclass for use in titlebar tabs
It uses a private compositing filter to match what the sytem does to
color unselected tabs in the window's tab bar (specifically with a
light appearance).
2024-02-08 10:10:40 +01:00
Mitchell Hashimoto
e5400bad06 config: add window-theme = auto for automatic choosing based on bg color 2024-02-01 20:49:28 -08:00
Mitchell Hashimoto
a41ee3cabe 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.
2024-01-27 09:58:02 -08:00
Mitchell Hashimoto
4c9fc452b6 macos: register that we accept/send text types for services 2024-01-21 17:07:24 -08:00
Mitchell Hashimoto
8b11d20cb0 macos: register a services menu 2024-01-21 16:39:52 -08:00
Mitchell Hashimoto
8b01d79502 macos: iOS bg color extends to unsafe areas 2024-01-18 20:31:41 -08:00
Mitchell Hashimoto
487c22011c macos: make SurfaceView cross-platform! 2024-01-18 19:28:36 -08:00
Qwerasd
51f53aa9bf Added macOS file open handler 2024-01-16 16:26:21 -05:00
Mitchell Hashimoto
875a774d4b macos: remove AppState and unify onto Ghostty.App cross-platform 2024-01-14 19:35:57 -08:00
Mitchell Hashimoto
eba3d5414d macos: Ghostty.Config to store all config-related operations 2024-01-14 15:53:33 -08:00
Mitchell Hashimoto
4d9fd2becc macos: iOS app can initialize Ghostty 2024-01-14 14:44:16 -08:00
Mitchell Hashimoto
83b004b6e1 macos: show ghostty icon on main app loading 2024-01-13 22:26:51 -08:00
Mitchell Hashimoto
48af1c6c99 macos: add iOS target 2024-01-13 22:24:35 -08:00