From 13df49dca28cf680a4d104630cd675de25d3e944 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Tue, 25 Nov 2008 00:39:52 -0800 Subject: [PATCH] XQuartz: Use the environment to pass the bundle's prefs domain on to xinit/quartz-wm for Tiger or no-launchd-LEOPARD (cherry picked from commit fbf4b0d33fa5dc618c3191a4e823232dfa33cd95) --- hw/xquartz/mach-startup/bundle-main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c index 058fe7865..fa19eab9a 100644 --- a/hw/xquartz/mach-startup/bundle-main.c +++ b/hw/xquartz/mach-startup/bundle-main.c @@ -426,6 +426,17 @@ int main(int argc, char **argv, char **envp) { /* Setup the initial crasherporter info */ strlcpy(__crashreporter_info__, __crashreporter_info__base, __crashreporter_info__len); + /* Pass on our prefs domain to startx and its inheritors (mainly for quartz-wm) */ + CFBundleRef bundle = CFBundleGetMainBundle(); + if(bundle) { + CFStringRef pd = CFBundleGetIdentifier(bundle); + if(pd) { + const char *pds = CFStringGetCStringPtr(pd, 0); + if(pds) + setenv("X11_PREFS_DOMAIN", pds, 1); + } + } + fprintf(stderr, "X11.app: main(): argc=%d\n", argc); for(i=0; i < argc; i++) { fprintf(stderr, "\targv[%u] = %s\n", (unsigned)i, argv[i]);