diff --git a/build.zig b/build.zig index c8fcd2915..0b225e6d8 100644 --- a/build.zig +++ b/build.zig @@ -1172,7 +1172,10 @@ fn addDeps( const wf = b.addWriteFiles(); const gresource_xml = wf.add( "gresource.xml", - if (config.libadwaita) gresource.gresource_xml_libadwaita else gresource.gresource_xml_gtk, + if (config.libadwaita) + gresource.gresource_xml_libadwaita + else + gresource.gresource_xml_gtk, ); const generate_resources_c = b.addSystemCommand(&.{ @@ -1182,17 +1185,10 @@ fn addDeps( "--generate-source", "--target", }); - const ghostty_resources_c = generate_resources_c.addOutputFileArg("ghostty_resources.c"); - generate_resources_c.addFileArg(gresource_xml); - generate_resources_c.extra_file_dependencies = if (config.libadwaita) &gresource.dependencies_libadwaita else &gresource.dependencies_gtk; - - step.addCSourceFile(.{ - .file = ghostty_resources_c, - .flags = &.{}, - }); + step.addCSourceFile(.{ .file = ghostty_resources_c, .flags = &.{} }); const generate_resources_h = b.addSystemCommand(&.{ "glib-compile-resources", @@ -1201,13 +1197,9 @@ fn addDeps( "--generate-header", "--target", }); - const ghostty_resources_h = generate_resources_h.addOutputFileArg("ghostty_resources.h"); - generate_resources_h.addFileArg(gresource_xml); - generate_resources_h.extra_file_dependencies = if (config.libadwaita) &gresource.dependencies_libadwaita else &gresource.dependencies_gtk; - step.addIncludePath(ghostty_resources_h.dirname()); } }, diff --git a/src/apprt/gtk/App.zig b/src/apprt/gtk/App.zig index 8ae896c3d..6da314c56 100644 --- a/src/apprt/gtk/App.zig +++ b/src/apprt/gtk/App.zig @@ -151,16 +151,12 @@ pub fn init(core_app: *CoreApp, opts: Options) !App { break :app @ptrCast(adw_app); }; - errdefer c.g_object_unref(app); - const gapp = @as(*c.GApplication, @ptrCast(app)); // force the resource path to a known value so that it doesn't depend on - // the app id + // the app id and load in compiled resources c.g_application_set_resource_base_path(gapp, "/com/mitchellh/ghostty"); - - // load compiled-in resources c.g_resources_register(c.ghostty_get_resource()); // The `activate` signal is used when Ghostty is first launched and when a