fix(gtk): register the gresource before startup so style.css loads

Ghostty's stylesheets (style.css, style-dark.css, style-hc*.css) were
never loaded. AdwApplication loads them from `resource-base-path` once,
during startup, and only if the resources exist at that moment. Zig's
gresource is registered by a glib-compile-resources C constructor before
main; the Rust build registered it lazily on first template instantiation
(windows, dialogs), i.e. after startup.

Visible effect: every rule in style.css was missing, e.g. the clipboard
confirmation dialog (`clipboard-read = ask`) rendered its preview without
the rounded inset and overlapping the "Remember choice" row.

Registering in Application::new restores parity; the Adwaita
"style-dark.css is deprecated" warnings Zig logs now appear too, which
confirms the files are picked up.

Test Plan:
- clipboard-read = ask, run `printf '\e]52;c;?\a'`: dialog is
  pixel-identical to Ghostty 1.3.1 (nested weston capture)
This commit is contained in:
ddidderr committed 2026-10-12 21:11:39 +02:00
1 parent 9a60b1d2db
commit 87dde3fafa
2 files changed
+8 -1

No files matched your search

@@ -419,6 +419,12 @@ impl Application {
pub fn new(core_app: Rc<dyn CoreApp>) -> Self {
init_locale();
// AdwApplication loads style.css & co. from `resource-base-path` once,
// during startup, and only if the resources exist then. Zig's
// gresource is registered by a C constructor before main; ours must
// be registered explicitly before startup.
crate::register_resources();
// Capture GLib/GObject/GTK log messages.
glib::log_set_writer_func(glib_log_writer);