ghostty_app_t is currently owned per-window. MainWindow constructs a
GhosttyHost that calls ghostty_app_new, so each window runs its own
libghostty app.
The macOS apprt has the inverse topology: one Ghostty app handle at the
app level, per-window surfaces registered against it. libghostty's C API
is designed for one app per process.
Two ways to align:
a) Full refactor. Move ghostty_app_t ownership out of GhosttyHost into
a dedicated app-level service. Per-window hosts hold only the surface
dictionary and callback delegates.
b) Minimal hoist. App.xaml.cs owns the single ghostty_app_t. Each
MainWindow constructs a GhosttyHost that wraps the shared handle plus
a per-window surface dictionary.
Which shape is more appropriate as app-level coordination surfaces appear
(command palette, global config reload, inspector, activation)?
ghostty_app_tis currently owned per-window.MainWindowconstructs aGhosttyHostthat callsghostty_app_new, so each window runs its ownlibghostty app.
The macOS apprt has the inverse topology: one Ghostty app handle at the
app level, per-window surfaces registered against it. libghostty's C API
is designed for one app per process.
Two ways to align:
a) Full refactor. Move
ghostty_app_townership out ofGhosttyHostintoa dedicated app-level service. Per-window hosts hold only the surface
dictionary and callback delegates.
b) Minimal hoist.
App.xaml.csowns the singleghostty_app_t. EachMainWindowconstructs aGhosttyHostthat wraps the shared handle plusa per-window surface dictionary.
Which shape is more appropriate as app-level coordination surfaces appear
(command palette, global config reload, inspector, activation)?