xquartz: Move default applications list outside of the main executable
This will allow side-wide customization. Fixes: https://github.com/XQuartz/XQuartz/issues/274 Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
This commit is contained in:
parent
3dbd809c0e
commit
e654de80ed
|
@ -96,10 +96,6 @@ NSString * const XQuartzPrefKeySyncPrimaryOnSelect = @"sync_primary_on_select";
|
||||||
defaults = [[[NSUserDefaults alloc] initWithSuiteName:defaultsDomain] retain];
|
defaults = [[[NSUserDefaults alloc] initWithSuiteName:defaultsDomain] retain];
|
||||||
}
|
}
|
||||||
|
|
||||||
NSArray * const defaultAppsMenu = @[
|
|
||||||
@[NSLocalizedString(@"Terminal", @"Terminal"), @"xterm", @"n"],
|
|
||||||
];
|
|
||||||
|
|
||||||
NSString *defaultWindowItemModifiers = @"command";
|
NSString *defaultWindowItemModifiers = @"command";
|
||||||
NSString * const defaultWindowItemModifiersLocalized = NSLocalizedString(@"window item modifiers", @"window item modifiers");
|
NSString * const defaultWindowItemModifiersLocalized = NSLocalizedString(@"window item modifiers", @"window item modifiers");
|
||||||
if (![defaultWindowItemModifiersLocalized isEqualToString:@"window item modifiers"]) {
|
if (![defaultWindowItemModifiersLocalized isEqualToString:@"window item modifiers"]) {
|
||||||
|
@ -107,7 +103,6 @@ NSString * const XQuartzPrefKeySyncPrimaryOnSelect = @"sync_primary_on_select";
|
||||||
}
|
}
|
||||||
|
|
||||||
NSDictionary<NSString *, id> * const defaultDefaultsDict = @{
|
NSDictionary<NSString *, id> * const defaultDefaultsDict = @{
|
||||||
XQuartzPrefKeyAppsMenu : defaultAppsMenu,
|
|
||||||
XQuartzPrefKeyFakeButtons : @(NO),
|
XQuartzPrefKeyFakeButtons : @(NO),
|
||||||
// XQuartzPrefKeyFakeButton2 nil default
|
// XQuartzPrefKeyFakeButton2 nil default
|
||||||
// XQuartzPrefKeyFakeButton3 nil default
|
// XQuartzPrefKeyFakeButton3 nil default
|
||||||
|
@ -141,6 +136,10 @@ NSString * const XQuartzPrefKeySyncPrimaryOnSelect = @"sync_primary_on_select";
|
||||||
};
|
};
|
||||||
|
|
||||||
[defaults registerDefaults:defaultDefaultsDict];
|
[defaults registerDefaults:defaultDefaultsDict];
|
||||||
|
|
||||||
|
NSString * const systemDefaultsPlistPath = [@(XQUARTZ_DATA_DIR) stringByAppendingPathComponent:@"defaults.plist"];
|
||||||
|
NSDictionary <NSString *, id> * const systemDefaultsDict = [NSDictionary dictionaryWithContentsOfFile:systemDefaultsPlistPath];
|
||||||
|
[defaults registerDefaults:systemDefaultsDict];
|
||||||
});
|
});
|
||||||
|
|
||||||
return defaults;
|
return defaults;
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
|
||||||
|
<!-- This file contains system-wide defaults for XQuartz -->
|
||||||
|
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>apps_menu</key>
|
||||||
|
<array>
|
||||||
|
<array>
|
||||||
|
<string>Terminal</string>
|
||||||
|
<string>xterm</string>
|
||||||
|
<string>n</string>
|
||||||
|
</array>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
|
@ -23,6 +23,7 @@ endif
|
||||||
bundle_id_def = '-DBUNDLE_ID_PREFIX="@0@"'.format(bundle_id_prefix)
|
bundle_id_def = '-DBUNDLE_ID_PREFIX="@0@"'.format(bundle_id_prefix)
|
||||||
|
|
||||||
bundle_root = join_paths(apple_applications_dir, apple_application_name + '.app')
|
bundle_root = join_paths(apple_applications_dir, apple_application_name + '.app')
|
||||||
|
xquartz_data_dir = join_paths(get_option('prefix'), get_option('datadir'),'X11', 'XQuartz')
|
||||||
|
|
||||||
# using sparkle update framework?
|
# using sparkle update framework?
|
||||||
build_sparkle = xquartz_sparkle_feed_url != '' and xquartz_sparkle_public_edkey != ''
|
build_sparkle = xquartz_sparkle_feed_url != '' and xquartz_sparkle_public_edkey != ''
|
||||||
|
@ -60,6 +61,7 @@ libxquartz_defs = [
|
||||||
'-DUSE_NEW_CLUT',
|
'-DUSE_NEW_CLUT',
|
||||||
'-DXFree86Server',
|
'-DXFree86Server',
|
||||||
'-DXQUARTZ',
|
'-DXQUARTZ',
|
||||||
|
'-DXQUARTZ_DATA_DIR="@0@"'.format(xquartz_data_dir),
|
||||||
'-DXSERVER_VERSION="@0@"'.format(meson.project_version()),
|
'-DXSERVER_VERSION="@0@"'.format(meson.project_version()),
|
||||||
bundle_id_def,
|
bundle_id_def,
|
||||||
sparkle_defs,
|
sparkle_defs,
|
||||||
|
@ -93,3 +95,7 @@ xquartz_man = configure_file(
|
||||||
configuration: manpage_config,
|
configuration: manpage_config,
|
||||||
)
|
)
|
||||||
install_man(xquartz_man)
|
install_man(xquartz_man)
|
||||||
|
|
||||||
|
install_data('defaults.plist',
|
||||||
|
install_dir: xquartz_data_dir,
|
||||||
|
install_mode: 'rw-r--r--')
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
build_standalone_pbproxy = get_option('xpbproxy')
|
build_standalone_pbproxy = get_option('xpbproxy')
|
||||||
|
|
||||||
pbproxy_defs = [bundle_id_def]
|
pbproxy_defs = [
|
||||||
|
'-DXQUARTZ_DATA_DIR="@0@"'.format(xquartz_data_dir),
|
||||||
|
bundle_id_def
|
||||||
|
]
|
||||||
if build_standalone_pbproxy
|
if build_standalone_pbproxy
|
||||||
pbproxy_defs += ['-DSTANDALONE_XPBPROXY']
|
pbproxy_defs += ['-DSTANDALONE_XPBPROXY']
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Reference in New Issue