[Xquartz-changes] xserver: Branch 'master' - 3 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Sun Apr 24 22:04:06 PDT 2011


 configure.ac                          |   13 ++++++++-----
 hw/xquartz/X11Application.m           |    2 +-
 hw/xquartz/bundle/Info.plist.cpp      |    4 ++--
 hw/xquartz/bundle/Makefile.am         |    2 +-
 hw/xquartz/darwin.c                   |   23 +++++++----------------
 hw/xquartz/darwin.h                   |    3 +++
 hw/xquartz/mach-startup/bundle-main.c |   18 +++++++++---------
 hw/xquartz/mach-startup/launchd_fd.c  |    4 ++--
 hw/xquartz/mach-startup/stub.c        |    2 +-
 hw/xquartz/pbproxy/Makefile.am        |    2 +-
 hw/xquartz/pbproxy/app-main.m         |    2 +-
 hw/xquartz/xpr/xprFrame.c             |    2 +-
 include/dix-config.h.in               |    7 ++-----
 manpages.am                           |    2 +-
 14 files changed, 40 insertions(+), 46 deletions(-)

New commits:
commit 4bb481d57e72b6e68a5547ed072d99656aea09d9
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Sun Apr 24 22:01:48 2011 -0700

    XQuartz: Enable logging to a file for better debugging
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index 0d2f9e2..2e18a74 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -589,6 +589,13 @@ void OsVendorFatalError( void )
 void OsVendorInit(void)
 {
     if (serverGeneration == 1) {
+        char *lf;
+        char *home = getenv("HOME");
+        assert(home);
+        assert(0 < asprintf(&lf, "%s/Library/Logs/X11.%s.log", home, bundle_id_prefix));
+        LogInit(lf, ".old");
+        free(lf);
+
         DarwinPrintBanner();
 #ifdef ENABLE_DEBUG_LOG
 	{
diff --git a/hw/xquartz/darwin.h b/hw/xquartz/darwin.h
index 3ba5d82..507c6f7 100644
--- a/hw/xquartz/darwin.h
+++ b/hw/xquartz/darwin.h
@@ -73,6 +73,9 @@ extern int              darwinDesiredDepth;
 extern int              darwinMainScreenX;
 extern int              darwinMainScreenY;
 
+// bundle-main.c
+extern char *bundle_id_prefix;
+
 #define ENABLE_DEBUG_LOG 1
 
 #ifdef ENABLE_DEBUG_LOG
diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c
index 2989021..bde259e 100644
--- a/hw/xquartz/mach-startup/bundle-main.c
+++ b/hw/xquartz/mach-startup/bundle-main.c
@@ -88,7 +88,7 @@ asm (".desc ___crashreporter_info__, 0x10");
 
 static const char *__crashreporter_info__base = "X.Org X Server " XSERVER_VERSION " Build Date: " BUILD_DATE;
 
-static char *bundle_id_prefix = NULL;
+char *bundle_id_prefix = NULL;
 static char *server_bootstrap_name = NULL;
 
 #define DEBUG 1
commit bad9d6040c1a28bfeed12521c75247d44c5b3ab6
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Sun Apr 24 21:35:04 2011 -0700

    XQuartz: Rename launchd-id-prefix to bundle-id-prefix
    
    It's used many other places than just for launchd.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/configure.ac b/configure.ac
index 56e51a4..86e67f0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -562,11 +562,14 @@ AC_ARG_WITH(apple-application-name,AS_HELP_STRING([--with-apple-application-name
 				[ APPLE_APPLICATION_NAME="${withval}" ],
 				[ APPLE_APPLICATION_NAME="X11" ])
 AC_SUBST([APPLE_APPLICATION_NAME])
-AC_ARG_WITH(launchd-id-prefix,  AS_HELP_STRING([--with-launchd-id-prefix=PATH], [Prefix to use for launchd identifiers (default: org.x)]),
-                                [ LAUNCHD_ID_PREFIX="${withval}" ],
-                                [ LAUNCHD_ID_PREFIX="org.x" ])
-AC_SUBST([LAUNCHD_ID_PREFIX])
-AC_DEFINE_UNQUOTED(LAUNCHD_ID_PREFIX, "$LAUNCHD_ID_PREFIX", [Prefix to use for launchd identifiers])
+AC_ARG_WITH(launchd-id-prefix,  AS_HELP_STRING([--with-launchd-id-prefix=PATH], [Deprecated: Use --with-bundle-id-prefix.]),
+                                [ BUNDLE_ID_PREFIX="${withval}" ],
+                                [ BUNDLE_ID_PREFIX="org.x" ])
+AC_ARG_WITH(bundle-id-prefix,  AS_HELP_STRING([--with-bundle-id-prefix=PATH], [Prefix to use for bundle identifiers (default: org.x)]),
+                               [ BUNDLE_ID_PREFIX="${withval}" ],
+                               [ BUNDLE_ID_PREFIX="org.x" ])
+AC_SUBST([BUNDLE_ID_PREFIX])
+AC_DEFINE_UNQUOTED(BUNDLE_ID_PREFIX, "$BUNDLE_ID_PREFIX", [Prefix to use for bundle identifiers])
 AC_ARG_ENABLE(sparkle,AS_HELP_STRING([--enable-sparkle], [Enable updating of X11.app using the Sparkle Framework (default: disabled)]),
 				[ XQUARTZ_SPARKLE="${enableval}" ],
 				[ XQUARTZ_SPARKLE="no" ])
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 6f89437..2a45cc5 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -1012,7 +1012,7 @@ void X11ApplicationMain (int argc, char **argv, char **envp) {
     NSMaxY([[NSScreen mainScreen] visibleFrame]);
 
 #ifdef HAVE_LIBDISPATCH
-    eventTranslationQueue = dispatch_queue_create(LAUNCHD_ID_PREFIX".X11.NSEventsToX11EventsQueue", NULL);
+    eventTranslationQueue = dispatch_queue_create(BUNDLE_ID_PREFIX".X11.NSEventsToX11EventsQueue", NULL);
     assert(eventTranslationQueue != NULL);
 #endif
     
diff --git a/hw/xquartz/bundle/Info.plist.cpp b/hw/xquartz/bundle/Info.plist.cpp
index 0e98218..03973c7 100644
--- a/hw/xquartz/bundle/Info.plist.cpp
+++ b/hw/xquartz/bundle/Info.plist.cpp
@@ -7,11 +7,11 @@
 	<key>CFBundleExecutable</key>
 		<string>X11</string>
 	<key>CFBundleGetInfoString</key>
-		<string>LAUNCHD_ID_PREFIX.X11</string>
+		<string>BUNDLE_ID_PREFIX.X11</string>
 	<key>CFBundleIconFile</key>
 		<string>X11.icns</string>
 	<key>CFBundleIdentifier</key>
-		<string>LAUNCHD_ID_PREFIX.X11</string>
+		<string>BUNDLE_ID_PREFIX.X11</string>
 	<key>CFBundleInfoDictionaryVersion</key>
 		<string>6.0</string>
 	<key>CFBundleName</key>
diff --git a/hw/xquartz/bundle/Makefile.am b/hw/xquartz/bundle/Makefile.am
index 8a206cf..6deecae 100644
--- a/hw/xquartz/bundle/Makefile.am
+++ b/hw/xquartz/bundle/Makefile.am
@@ -1,7 +1,7 @@
 include cpprules.in
 
 CPP_FILES_FLAGS = \
-	-DLAUNCHD_ID_PREFIX="$(LAUNCHD_ID_PREFIX)" \
+	-DBUNDLE_ID_PREFIX="$(BUNDLE_ID_PREFIX)" \
 	-DAPPLE_APPLICATION_NAME="$(APPLE_APPLICATION_NAME)"
 
 if XQUARTZ_SPARKLE
diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c
index d70cfd4..2989021 100644
--- a/hw/xquartz/mach-startup/bundle-main.c
+++ b/hw/xquartz/mach-startup/bundle-main.c
@@ -88,7 +88,7 @@ asm (".desc ___crashreporter_info__, 0x10");
 
 static const char *__crashreporter_info__base = "X.Org X Server " XSERVER_VERSION " Build Date: " BUILD_DATE;
 
-static char *launchd_id_prefix = NULL;
+static char *bundle_id_prefix = NULL;
 static char *server_bootstrap_name = NULL;
 
 #define DEBUG 1
@@ -491,7 +491,7 @@ static void setup_env(void) {
 
     /* fallback to hardcoded value if we can't discover it */
     if(!pds) {
-        pds = LAUNCHD_ID_PREFIX".X11";
+        pds = BUNDLE_ID_PREFIX".X11";
     }
 
     server_bootstrap_name = strdup(pds);
@@ -502,12 +502,12 @@ static void setup_env(void) {
     setenv("X11_PREFS_DOMAIN", server_bootstrap_name, 1);
     
     len = strlen(server_bootstrap_name);
-    launchd_id_prefix = malloc(sizeof(char) * (len - 3));
-    if(!launchd_id_prefix) {
+    bundle_id_prefix = malloc(sizeof(char) * (len - 3));
+    if(!bundle_id_prefix) {
         fprintf(stderr, "X11.app: Memory allocation error.\n");
         exit(1);
     }
-    strlcpy(launchd_id_prefix, server_bootstrap_name, len - 3);
+    strlcpy(bundle_id_prefix, server_bootstrap_name, len - 3);
     
     /* We need to unset DISPLAY if it is not our socket */
     if(disp) {
@@ -519,7 +519,7 @@ static void setup_env(void) {
         }
 
         if(s && *s) {
-            if(strcmp(launchd_id_prefix, "org.x") == 0 && strcmp(s, ":0") == 0) {
+            if(strcmp(bundle_id_prefix, "org.x") == 0 && strcmp(s, ":0") == 0) {
                 fprintf(stderr, "X11.app: Detected old style launchd DISPLAY, please update xinit.\n");
             } else {
                 temp = (char *)malloc(sizeof(char) * len);
@@ -527,12 +527,12 @@ static void setup_env(void) {
                     fprintf(stderr, "X11.app: Memory allocation error creating space for socket name test.\n");
                     exit(1);
                 }
-                strlcpy(temp, launchd_id_prefix, len);
+                strlcpy(temp, bundle_id_prefix, len);
                 strlcat(temp, ":0", len);
             
                 if(strcmp(temp, s) != 0) {
                     /* If we don't have a match, unset it. */
-                    fprintf(stderr, "X11.app: DISPLAY (\"%s\") does not match our id (\"%s\"), unsetting.\n", disp, launchd_id_prefix);
+                    fprintf(stderr, "X11.app: DISPLAY (\"%s\") does not match our id (\"%s\"), unsetting.\n", disp, bundle_id_prefix);
                     unsetenv("DISPLAY");
                 }
                 free(temp);
@@ -632,7 +632,7 @@ int main(int argc, char **argv, char **envp) {
     fprintf(stderr, "Waiting for startup parameters via Mach IPC.\n");
     kr = mach_msg_server(mach_startup_server, mxmsgsz, mp, 0);
     if (kr != KERN_SUCCESS) {
-        fprintf(stderr, "%s.X11(mp): %s\n", LAUNCHD_ID_PREFIX, mach_error_string(kr));
+        fprintf(stderr, "%s.X11(mp): %s\n", BUNDLE_ID_PREFIX, mach_error_string(kr));
         return EXIT_FAILURE;
     }
     
diff --git a/hw/xquartz/mach-startup/launchd_fd.c b/hw/xquartz/mach-startup/launchd_fd.c
index 6dace8e..5c7e03c 100644
--- a/hw/xquartz/mach-startup/launchd_fd.c
+++ b/hw/xquartz/mach-startup/launchd_fd.c
@@ -69,11 +69,11 @@ int launchd_display_fd(void) {
         return ERROR_FD;
     }
     
-    listening_fd_array = launch_data_dict_lookup(sockets_dict, LAUNCHD_ID_PREFIX":0");
+    listening_fd_array = launch_data_dict_lookup(sockets_dict, BUNDLE_ID_PREFIX":0");
     if (NULL == listening_fd_array) {
         listening_fd_array = launch_data_dict_lookup(sockets_dict, ":0");
         if (NULL == listening_fd_array) {
-            fprintf(stderr,"launchd check-in: No known sockets found to answer requests on! \"%s:0\" and \":0\" failed.\n", LAUNCHD_ID_PREFIX);
+            fprintf(stderr,"launchd check-in: No known sockets found to answer requests on! \"%s:0\" and \":0\" failed.\n", BUNDLE_ID_PREFIX);
             return ERROR_FD;
         }
     }
diff --git a/hw/xquartz/mach-startup/stub.c b/hw/xquartz/mach-startup/stub.c
index 1804560..3653bca 100644
--- a/hw/xquartz/mach-startup/stub.c
+++ b/hw/xquartz/mach-startup/stub.c
@@ -40,7 +40,7 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 
-#define kX11AppBundleId LAUNCHD_ID_PREFIX".X11"
+#define kX11AppBundleId BUNDLE_ID_PREFIX".X11"
 #define kX11AppBundlePath "/Contents/MacOS/X11"
 
 static char *server_bootstrap_name = kX11AppBundleId;
diff --git a/hw/xquartz/pbproxy/Makefile.am b/hw/xquartz/pbproxy/Makefile.am
index 1886642..b8b95d2 100644
--- a/hw/xquartz/pbproxy/Makefile.am
+++ b/hw/xquartz/pbproxy/Makefile.am
@@ -1,5 +1,5 @@
 AM_CPPFLAGS=-F/System/Library/Frameworks/ApplicationServices.framework/Frameworks \
-	-DLAUNCHD_ID_PREFIX=\"$(LAUNCHD_ID_PREFIX)\"
+	-DBUNDLE_ID_PREFIX=\"$(BUNDLE_ID_PREFIX)\"
 
 AM_CFLAGS=$(XPBPROXY_CFLAGS) 
 
diff --git a/hw/xquartz/pbproxy/app-main.m b/hw/xquartz/pbproxy/app-main.m
index b00e90a..245d1bc 100644
--- a/hw/xquartz/pbproxy/app-main.m
+++ b/hw/xquartz/pbproxy/app-main.m
@@ -34,7 +34,7 @@
 #include <unistd.h> /*for getpid*/
 #include <Cocoa/Cocoa.h>
 
-static const char *app_prefs_domain = 	LAUNCHD_ID_PREFIX".xpbproxy";
+static const char *app_prefs_domain = 	BUNDLE_ID_PREFIX".xpbproxy";
 CFStringRef app_prefs_domain_cfstr;
 
 /* Stubs */
diff --git a/hw/xquartz/xpr/xprFrame.c b/hw/xquartz/xpr/xprFrame.c
index 066cc0f..5f6b1cb 100644
--- a/hw/xquartz/xpr/xprFrame.c
+++ b/hw/xquartz/xpr/xprFrame.c
@@ -477,7 +477,7 @@ xprInit(ScreenPtr pScreen)
 
     assert((window_hash = x_hash_table_new(NULL, NULL, NULL, NULL)));
 #ifdef HAVE_LIBDISPATCH
-    assert((window_hash_serial_q = dispatch_queue_create(LAUNCHD_ID_PREFIX".X11.xpr_window_hash", NULL)));
+    assert((window_hash_serial_q = dispatch_queue_create(BUNDLE_ID_PREFIX".X11.xpr_window_hash", NULL)));
 #else
     assert(0 == pthread_mutex_init(&window_hash_mutex, NULL));
 #endif
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index ab97978..b7fccdb 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -124,8 +124,8 @@
 /* Support application updating through sparkle. */
 #undef XQUARTZ_SPARKLE
 
-/* Prefix to use for launchd identifiers */
-#undef LAUNCHD_ID_PREFIX
+/* Prefix to use for bundle identifiers */
+#undef BUNDLE_ID_PREFIX
 
 /* Build a standalone xpbproxy */
 #undef STANDALONE_XPBPROXY
diff --git a/manpages.am b/manpages.am
index 69ee005..03089e3 100644
--- a/manpages.am
+++ b/manpages.am
@@ -24,7 +24,7 @@ MAN_SUBSTS += 	-e 's|__logdir__|$(logdir)|g' \
 		-e 's|__sysconfdir__|$(sysconfdir)|g' \
 		-e 's|__xconfigdir__|$(__XCONFIGDIR__)|g' \
 		-e 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' \
-		-e 's|__laucnd_id_prefix__|$(LAUNCHD_ID_PREFIX)|g' \
+		-e 's|__laucnd_id_prefix__|$(BUNDLE_ID_PREFIX)|g' \
 		-e 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' \
 		-e 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' \
 		-e '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g'
commit 7c8e4ec66da90dab2ee49586e5a2eda5cc1c51be
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Sun Apr 24 20:35:06 2011 -0700

    XQuartz: Dead code removal
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index 00be74b..0d2f9e2 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -133,22 +133,6 @@ static PixmapFormatRec formats[] = {
 };
 const int NUMFORMATS = sizeof(formats)/sizeof(formats[0]);
 
-#ifndef OSNAME
-#define OSNAME " Darwin"
-#endif
-#ifndef OSVENDOR
-#define OSVENDOR ""
-#endif
-#ifndef PRE_RELEASE
-#define PRE_RELEASE XORG_VERSION_SNAP
-#endif
-#ifndef BUILD_DATE
-#define BUILD_DATE ""
-#endif
-#ifndef XORG_RELEASE
-#define XORG_RELEASE "?"
-#endif
-
 void
 DarwinPrintBanner(void)
 { 
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 4fd49ef..ab97978 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -30,9 +30,6 @@
 /* Support Damage extension */
 #undef DAMAGE
 
-/* Build for darwin with Quartz support */
-#undef DARWIN_WITH_QUARTZ
-
 /* Use OsVendorVErrorF */
 #undef DDXOSVERRORF
 


More information about the Xquartz-changes mailing list