Previously, we would access the `ghostty.config` object from anywhere.
The issue with this is that memory lifetime access to the underlying
`ghostty_config_t` was messy. It was easy when the apprt owned every
reference but since automatic theme changes were implemented, this isn't
always true anymore.
To fix this, we move to the same pattern we use internally in the core
of ghostty: whenever the config changes, we handle an event, derive our
desired values out of the config (copy them), and then let the caller
free the config if they want to. This way, we can be sure that any
information we need from the config is always owned by us.
Fixes#2519
This sets up the colorspace for terminal windows in the base controller.
This also modifies some of our logic so its easier for subclasses of
base controllers to specify custom logic when the configuration reloads,
since that's likely to be a common thing.
Fixes#2409
This is one of the weirder macOS quirks (bugs? who knows!) I've seen
recently. The bug as described in #2409: when you have at least two
monitors ("screens" in AppKit parlance), Ghostty on one, a focused app
on the other, and you toggle the quick terminal, the quick terminal
does not have focus.
We already knew and accounted for the fact that
`window.makeKeyAndOrderFront(nil)` does not work until the window is visible
and on the target screen. To do this, we only called this once the
animation was complete. For the same NSScreen, this works, but for
another screen, it does not.
Using one DispatchQueue.async tick also does not work. Based on testing,
it takes anywhere from 2 to 5 ticks to get the window focus API to work
properly. Okay.
The solution I came up with here is to retry the focus operation every
25ms up to 250ms. This has worked consistently for me within the first 5
ticks but it is obviously a hack so I'm not sure if this is all right.
This fixes the issue but if there's a better way to do this, I'm all
ears!
Fixes#2330
The quick terminal now supports fullscreen. The fullscreen mode is
always non-native due to the quick terminal being a titleless, floating
window.
When the quick terminal loses focus and animates out, it will always
exit fullscreen mode.