12 Commits

Author SHA1 Message Date
Mitchell Hashimoto
35fcb1a29b
macos: change config access to evented, derived config like libghostty
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.
2024-11-21 11:36:51 -08:00
pnodet
7ff9af1520
style(macos): cleanup trailing spaces 2024-08-21 21:53:09 +02:00
Mitchell Hashimoto
eba3d5414d
macos: Ghostty.Config to store all config-related operations 2024-01-14 15:53:33 -08:00
Mitchell Hashimoto
f93c41669e
macos: order main window front on restore 2024-01-03 12:10:52 -08:00
Mitchell Hashimoto
c9ff034b62
macos: prevent super hot loop to restore focus state 2024-01-03 12:07:03 -08:00
Mitchell Hashimoto
0008fb0a27
macos: set surface tree on init in restore
This prevents an unnecessary SurfaceView from being created. Creating a
SurfaceView is very expensive because this starts multiple threads,
creates the pty, starts the pty process, etc.

Additionally, this was exposing what I believe to be #497 when restoring
state: a surface view was created and destroyed very quickly causing
hangs on some machines. This still needs to be resolved but the behavior
in this commit was still a bug anyways.
2023-12-27 20:12:46 -08:00
Mitchell Hashimoto
2aa7f12417
macos: increment restorable state version 2023-12-26 14:45:39 -08:00
Mitchell Hashimoto
98041940f0
macos: restore focused split on app restore 2023-12-26 14:45:27 -08:00
Mitchell Hashimoto
20f9a3baab
macos: reset state version to 1 2023-12-23 18:59:19 -08:00
Mitchell Hashimoto
2390668834
macos: encode surface tree in state restore 2023-12-23 13:15:46 -08:00
Mitchell Hashimoto
a5d249eb48
config: if window-save-state is never, never restore state 2023-12-22 22:00:25 -08:00
Mitchell Hashimoto
59f54a1d88
macos: initial window save/restore is working for frames only 2023-12-22 21:24:27 -08:00