core, gtk: implement host resources dir for Flatpak

Introduces host resources directory as a new concept: A directory
containing application resources that can only be accessed from the host
operating system. This is significant for sandboxed application runtimes
like Flatpak where shells spawned on the host should have access to
application resources to enable integrations.

Alongside this, apprt is now allowed to override the resources lookup
logic.
This commit is contained in:
Leorize
2025-03-10 16:27:15 -05:00
committed by Mitchell Hashimoto
parent 82859bd844
commit 1688f2576c
8 changed files with 80 additions and 16 deletions

View File

@@ -115,7 +115,8 @@ pub fn run(gpa_alloc: std.mem.Allocator) !u8 {
const stderr = std.io.getStdErr().writer();
const stdout = std.io.getStdOut().writer();
if (global_state.resources_dir == null)
const resources_dir = global_state.resources_dir.app();
if (resources_dir == null)
try stderr.print("Could not find the Ghostty resources directory. Please ensure " ++
"that Ghostty is installed correctly.\n", .{});