xserver: Branch 'xorg-server-1.4-apple' - 3 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Fri May 23 01:42:56 PDT 2008


 configure.ac                          |   17 ----------
 hw/xquartz/X11Application.m           |   11 -------
 hw/xquartz/mach-startup/bundle-main.c |   53 +++++++++++++++++++++-------------
 include/dix-config.h.in               |    3 -
 4 files changed, 34 insertions(+), 50 deletions(-)

New commits:
commit 36db2ace75fa776bb75ad58baced70449edd4d5f
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Fri May 23 01:42:51 2008 -0700

    1.4.0-apple12

diff --git a/configure.ac b/configure.ac
index eb53e62..aaf32a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,7 +26,7 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.4.0-apple11, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+AC_INIT([xorg-server], 1.4.0-apple12, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([dist-bzip2 foreign])
 AM_MAINTAINER_MODE
commit 1e1f4fb717d2f3a3227be2a034d28d6a4f29b5d1
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Fri May 23 01:42:24 2008 -0700

    XQuartz: Don't need launchd checking in configure.ac anymore since its functionality has been removed from libxtrans and into the mach startup code.

diff --git a/configure.ac b/configure.ac
index 566f253..eb53e62 100644
--- a/configure.ac
+++ b/configure.ac
@@ -470,7 +470,6 @@ AC_ARG_WITH(apple-applications-dir,AS_HELP_STRING([--with-apple-applications-dir
 				[ APPLE_APPLICATIONS_DIR="${withval}" ],
 				[ APPLE_APPLICATIONS_DIR="/Applications/Utilities" ])
 AC_SUBST([APPLE_APPLICATIONS_DIR])
-AC_ARG_WITH(launchd,          AS_HELP_STRING([--with-launchd], [Build with support for Apple's launchd (default: auto)]), [LAUNCHD=$withval], [LAUNCHD=auto])
 AC_ARG_WITH(launchagents-dir,AS_HELP_STRING([--with-launchagents-dir=PATH], [Path to launchd's LaunchAgents directory (default: /Library/LaunchAgents)]),
 				[ launchagentsdir="${withval}" ],
 				[ launchagentsdir="/Library/LaunchAgents" ])
@@ -1783,20 +1782,6 @@ AM_CONDITIONAL(HAVE_XPLUGIN, [test "x$ac_cv_lib_Xplugin_xp_init" = xyes])
 AM_CONDITIONAL(HAVE_AGL_FRAMEWORK, [test "x$xorg_cv_AGL_framework" = xyes])
 AM_CONDITIONAL(XQUARTZ, [test "x$XQUARTZ" = xyes])
 
-if test "x$LAUNCHD" = "xauto"; then
-	if test "x$XQUARTZ" = "xyes" ; then
-		LAUNCHD=yes
-	else
-		unset LAUNCHD
-		AC_CHECK_PROG(LAUNCHD, [launchd], [yes], [no])
-	fi
-fi
-
-if test "x$LAUNCHD" = "xyes" ; then
-	AC_DEFINE(HAVE_LAUNCHD, 1, [launchd support available])
-fi
-AM_CONDITIONAL(LAUNCHD, [test "x$LAUNCHD" = "xyes"])
-
 dnl kdrive DDX
 
 XEPHYR_LIBS=
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 819ba02..e224b5a 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -142,9 +142,6 @@
 /* Define to 1 if you have version 2.2 (or newer) of the drm library */
 #undef HAVE_LIBDRM_2_2
 
-/* Define to 1 if launchd is available. */
-#undef HAVE_LAUNCHD
-
 /* Have Quartz */
 #undef XQUARTZ
 
commit c3866c98d23020d2151977ee1177b6054d05832e
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Fri May 23 01:39:02 2008 -0700

    XQuartz: Move the launchd display grabbing into mach_startup

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index c2d3e6d..f9222fe 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -44,9 +44,6 @@
 #include "X11/extensions/applewm.h"
 #include "micmap.h"
 
-#include "os.h"
-#include "mach-startup/launchd_fd.h"
-
 #include <mach/mach.h>
 #include <unistd.h>
 
@@ -817,14 +814,6 @@ void X11ApplicationMain (int argc, char **argv, char **envp) {
     /* Tell the server thread that it can proceed */
     QuartzInitServer(argc, argv, envp);
     
-#ifndef NEW_LAUNCH_METHOD
-    /* Start listening on the launchd fd */
-    int launchd_fd = launchd_display_fd();
-    if(launchd_fd != -1) {
-        DarwinListenOnOpenFD(launchd_fd);
-    }
-#endif
-
     [NSApp run];
     /* not reached */
 }
diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c
index 0fab990..73c0483 100644
--- a/hw/xquartz/mach-startup/bundle-main.c
+++ b/hw/xquartz/mach-startup/bundle-main.c
@@ -47,6 +47,10 @@
 #include "mach_startup.h"
 #include "mach_startupServer.h"
 
+#include "launchd_fd.h"
+void DarwinListenOnOpenFD(int fd);
+
+
 #define DEFAULT_CLIENT "/usr/X11/bin/xterm"
 #define DEFAULT_STARTX "/usr/X11/bin/startx"
 #define DEFAULT_SHELL  "/bin/sh"
@@ -60,8 +64,21 @@ int server_main(int argc, char **argv, char **envp);
 static int execute(const char *command);
 static char *command_from_prefs(const char *key, const char *default_value);
 
-#ifdef NEW_LAUNCH_METHOD
+/*** Pthread Magics ***/
+static pthread_t create_thread(void *func, void *arg) {
+    pthread_attr_t attr;
+    pthread_t tid;
+	
+    pthread_attr_init (&attr);
+    pthread_attr_setscope (&attr, PTHREAD_SCOPE_SYSTEM);
+    pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
+    pthread_create (&tid, &attr, func, arg);
+    pthread_attr_destroy (&attr);
+	
+    return tid;
+}
 
+#ifdef NEW_LAUNCH_METHOD
 struct arg {
     int argc;
     char **argv;
@@ -106,20 +123,6 @@ static mach_port_t checkin_or_register(char *bname) {
     return mp;
 }
 
-/*** Pthread Magics ***/
-static pthread_t create_thread(void *func, void *arg) {
-    pthread_attr_t attr;
-    pthread_t tid;
-	
-    pthread_attr_init (&attr);
-    pthread_attr_setscope (&attr, PTHREAD_SCOPE_SYSTEM);
-    pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
-    pthread_create (&tid, &attr, func, arg);
-    pthread_attr_destroy (&attr);
-	
-    return tid;
-}
-
 /*** $DISPLAY handoff ***/
 /* From darwinEvents.c ... but don't want to pull in all the server cruft */
 void DarwinListenOnOpenFD(int fd);
@@ -289,6 +292,8 @@ kern_return_t do_start_x11_server(mach_port_t port, string_array_t argv,
 
 int startup_trigger(int argc, char **argv, char **envp) {
 #else
+void *add_launchd_display_thread(void *data);
+    
 int main(int argc, char **argv, char **envp) {
 #endif
     Display *display;
@@ -345,6 +350,7 @@ int main(int argc, char **argv, char **envp) {
         }
         exit(EXIT_SUCCESS);
 #else
+        create_thread(add_launchd_display_thread, NULL);
         return server_main(argc, argv, envp);
 #endif
     }
@@ -356,14 +362,9 @@ int main(int argc, char **argv, char **envp) {
         /* Now, try to open a display, if so, run the launcher */
         display = XOpenDisplay(NULL);
         if(display) {
-            fprintf(stderr, "X11.app: Closing the display and sleeping for 2s to allow the X server to start up.\n");
             /* Could open the display, start the launcher */
             XCloseDisplay(display);
             
-            /* Give 2 seconds for the server to start... 
-             * TODO: *Really* fix this race condition
-             */
-            usleep(2000);
             return execute(command_from_prefs("app_to_run", DEFAULT_CLIENT));
         }
     }
@@ -434,6 +435,18 @@ int main(int argc, char **argv, char **envp) {
     
     return EXIT_SUCCESS;
 }
+#else
+void *add_launchd_display_thread(void *data) {
+    /* TODO: Really fix this race */
+    sleep(5);
+    
+    /* Start listening on the launchd fd */
+    int launchd_fd = launchd_display_fd();
+    if(launchd_fd != -1) {
+        DarwinListenOnOpenFD(launchd_fd);
+    }
+    return NULL;
+}
 #endif
     
 static int execute(const char *command) {


More information about the xorg-commit mailing list