Skip to content

Commit 7fad2c7

Browse files
committed
fix: use build_config.bundle_id for GSettings schema lookup
1 parent abe9791 commit 7fad2c7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/apprt/gtk/settings.zig

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! GSettings wrapper for window state persistence on Linux
22
const std = @import("std");
3+
const build_config = @import("../../build_config.zig");
34
const gio = @import("gio");
45
const glib = @import("glib");
56

@@ -15,8 +16,6 @@ pub const WindowSize = struct {
1516
pub const Settings = struct {
1617
settings: ?*gio.Settings,
1718

18-
const schema_id = "com.mitchellh.ghostty";
19-
2019
/// Initialize GSettings. Returns null if schema is not installed.
2120
pub fn init() Settings {
2221
// Check if schema exists before trying to use it
@@ -27,15 +26,15 @@ pub const Settings = struct {
2726

2827
const schema = gio.SettingsSchemaSource.lookup(
2928
source,
30-
schema_id,
29+
build_config.bundle_id,
3130
@intFromBool(false),
3231
) orelse {
33-
log.info("GSettings schema '{s}' not installed, window state will not persist", .{schema_id});
32+
log.info("GSettings schema '{s}' not installed, window state will not persist", .{build_config.bundle_id});
3433
return .{ .settings = null };
3534
};
3635
defer schema.unref();
3736

38-
const settings = gio.Settings.new(schema_id);
37+
const settings = gio.Settings.new(build_config.bundle_id);
3938
return .{ .settings = settings };
4039
}
4140

0 commit comments

Comments
 (0)