From a148adc5e4018577fe370e9cad74e621234a05b8 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 14 Aug 2025 12:28:25 -0700 Subject: [PATCH] apprt: make gtk-ng the default apprt on Linux --- src/apprt.zig | 20 +++++++++++--------- src/build/GhosttyDist.zig | 5 +++++ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/apprt.zig b/src/apprt.zig index 706287302..6c1f040ea 100644 --- a/src/apprt.zig +++ b/src/apprt.zig @@ -60,20 +60,22 @@ pub const Runtime = enum { /// This is only useful if you're only interested in the lib only (macOS). none, - /// GTK-backed. Rich windowed application. GTK is dynamically linked. - gtk, - - /// GTK4. The "-ng" variant is a rewrite of the GTK backend using - /// GTK-native technologies such as full GObject classes, Blueprint - /// files, etc. + /// GTK4. Rich windowed application. This uses a full GObject-based + /// approach to building the application. @"gtk-ng", + /// GTK-backed. Rich windowed application. GTK is dynamically linked. + /// WARNING: Deprecated. This will be removed very soon. All bug fixes + /// and features should go into the gtk-ng backend. + gtk, + pub fn default(target: std.Target) Runtime { - // The Linux default is GTK because it is full featured. - if (target.os.tag == .linux) return .gtk; + // The Linux default is GTK because it is a full featured application. + if (target.os.tag == .linux) return .@"gtk-ng"; // Otherwise, we do NONE so we don't create an exe and we - // create libghostty. + // create libghostty. On macOS, Xcode is used to build the app + // that links to libghostty. return .none; } }; diff --git a/src/build/GhosttyDist.zig b/src/build/GhosttyDist.zig index 25ec7182b..6123582b7 100644 --- a/src/build/GhosttyDist.zig +++ b/src/build/GhosttyDist.zig @@ -25,6 +25,11 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyDist { try resources.append(alloc, gtk.resources_c); try resources.append(alloc, gtk.resources_h); } + { + const gtk = SharedDeps.gtkNgDistResources(b); + try resources.append(alloc, gtk.resources_c); + try resources.append(alloc, gtk.resources_h); + } // git archive to create the final tarball. "git archive" is the // easiest way I can find to create a tarball that ignores stuff