xserver: Branch 'xorg-server-1.2-apple' - 2 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Thu Jul 24 11:00:55 PDT 2008


 configure.ac                 |    4 +-
 hw/xquartz/Makefile.am       |    2 +
 hw/xquartz/bundle/Info.plist |    8 ++--
 hw/xquartz/launchd_fd.c      |   82 +++++++++++++++++++++++++++++++++++++++++++
 hw/xquartz/launchd_fd.h      |   36 ++++++++++++++++++
 hw/xquartz/quartzStartup.c   |    4 ++
 6 files changed, 131 insertions(+), 5 deletions(-)

New commits:
commit c5c67b47fe86c5038b300e498ec3e3e751bd87fc
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Wed Jul 23 12:23:53 2008 -0700

    1.3.0-apple22

diff --git a/configure.ac b/configure.ac
index 2392cb8..82e5db4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,7 +28,7 @@ dnl Process this file with autoconf to create configure.
 AC_PREREQ(2.57)
 dnl This is the not the Xorg version number, it's the server version number.
 dnl Yes, that's weird.
-AC_INIT([xorg-server], 1.3.0-apple21, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+AC_INIT([xorg-server], 1.3.0-apple22, [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 b919376d69a4790a20409ecee996a4d333bee98b
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Wed Jul 23 12:23:39 2008 -0700

    Moved the 1.3 server to use the same xtrans changes as the 1.4 branch.

diff --git a/configure.ac b/configure.ac
index 429492b..2392cb8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1661,7 +1661,7 @@ if test "x$XQUARTZ" = xyes; then
 	DARWIN_LIBS="$MI_LIB $OS_LIB $DIX_LIB $FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $DARWIN_GLX_LIBS"
 	AC_SUBST([DARWIN_LIBS])
 	AC_CHECK_LIB([Xplugin],[xp_init],[:])
-	CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DNO_ALLOCA"
+	CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DNO_ALLOCA -DXQUARTZ_EXPORTS_LAUNCHD_FD"
 	if test "x$XF86MISC" = xyes || test "x$XF86MISC" = xauto; then
 		AC_MSG_NOTICE([Disabling XF86Misc extension])
 		XF86MISC=no
diff --git a/hw/xquartz/Makefile.am b/hw/xquartz/Makefile.am
index 5e70446..a205b8f 100644
--- a/hw/xquartz/Makefile.am
+++ b/hw/xquartz/Makefile.am
@@ -26,6 +26,7 @@ libXquartz_la_SOURCES = \
 	darwinKeyboard.c \
 	darwinXinput.c \
 	keysym2ucs.c \
+	launchd_fd.c \
 	pseudoramiX.c \
 	quartz.c \
 	quartzAudio.c \
@@ -44,6 +45,7 @@ EXTRA_DIST = \
 	darwinEvents.h \
 	darwinKeyboard.h \
 	keysym2ucs.h \
+	launchd_fd.h \
 	pseudoramiX.h \
 	quartz.h \
 	quartzAudio.h \
diff --git a/hw/xquartz/bundle/Info.plist b/hw/xquartz/bundle/Info.plist
index 4d1ae54..a16e846 100644
--- a/hw/xquartz/bundle/Info.plist
+++ b/hw/xquartz/bundle/Info.plist
@@ -19,7 +19,11 @@
 	<key>CFBundlePackageType</key>
 		<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-		<string>2.2.1</string>
+		<string>2.1.5</string>
+	<key>CFBundleVersion</key>
+		<string>2.1.5</string>
+	<key>CFBundleVersionString</key>
+		<string>2.1.5</string>
 	<key>CFBundleSignature</key>
 		<string>x11a</string>
 	<key>CSResourcesFileMapped</key>
@@ -33,7 +37,5 @@ Copyright © 2003-2008, X.org Foundation, Inc.
 		<string>main</string>
 	<key>NSPrincipalClass</key>
 		<string>X11Application</string>
-	<key>LSBackgroundOnly</key>
-		<true/>
 </dict>
 </plist>
diff --git a/hw/xquartz/launchd_fd.c b/hw/xquartz/launchd_fd.c
new file mode 100644
index 0000000..44a243a
--- /dev/null
+++ b/hw/xquartz/launchd_fd.c
@@ -0,0 +1,82 @@
+/* Copyright (c) 2008 Apple Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT.  IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
+ * HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above
+ * copyright holders shall not be used in advertising or otherwise to
+ * promote the sale, use or other dealings in this Software without
+ * prior written authorization.
+ */
+
+#include <launch.h>
+#include <stdio.h>
+#include <errno.h>
+
+#include "launchd_fd.h"
+
+int launchd_display_fd() {
+    launch_data_t sockets_dict, checkin_request, checkin_response;
+    launch_data_t listening_fd_array, listening_fd;
+
+    /* Get launchd fd */
+    if ((checkin_request = launch_data_new_string(LAUNCH_KEY_CHECKIN)) == NULL) {
+        fprintf(stderr,"launch_data_new_string(\"" LAUNCH_KEY_CHECKIN "\") Unable to create string.\n");
+        return ERROR_FD;
+    }
+    
+    if ((checkin_response = launch_msg(checkin_request)) == NULL) {
+        fprintf(stderr,"launch_msg(\"" LAUNCH_KEY_CHECKIN "\") IPC failure: %s\n",strerror(errno));
+        return ERROR_FD;
+    }
+    
+    if (LAUNCH_DATA_ERRNO == launch_data_get_type(checkin_response)) {
+        // ignore EACCES, which is common if we weren't started by launchd
+        if (launch_data_get_errno(checkin_response) != EACCES)
+            fprintf(stderr,"launchd check-in failed: %s\n", strerror(launch_data_get_errno(checkin_response)));
+        return ERROR_FD;
+    } 
+    
+    sockets_dict = launch_data_dict_lookup(checkin_response, LAUNCH_JOBKEY_SOCKETS);
+    if (NULL == sockets_dict) {
+        fprintf(stderr,"launchd check-in: no sockets found to answer requests on!\n");
+        return ERROR_FD;
+    }
+    
+    if (launch_data_dict_get_count(sockets_dict) > 1) {
+        fprintf(stderr,"launchd check-in: some sockets will be ignored!\n");
+        return ERROR_FD;
+    }
+    
+    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!\n");
+        return ERROR_FD;
+    }
+    
+    if (launch_data_array_get_count(listening_fd_array)!=1) {
+        fprintf(stderr,"launchd check-in: Expected 1 socket from launchd, got %u)\n",
+                (unsigned)launch_data_array_get_count(listening_fd_array));
+        return ERROR_FD;
+    }
+    
+    listening_fd=launch_data_array_get_index(listening_fd_array, 0);
+    return launch_data_get_fd(listening_fd);
+}
diff --git a/hw/xquartz/launchd_fd.h b/hw/xquartz/launchd_fd.h
new file mode 100644
index 0000000..5083fae
--- /dev/null
+++ b/hw/xquartz/launchd_fd.h
@@ -0,0 +1,36 @@
+/* Copyright (c) 2008 Apple Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT.  IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
+ * HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above
+ * copyright holders shall not be used in advertising or otherwise to
+ * promote the sale, use or other dealings in this Software without
+ * prior written authorization.
+ */
+
+#ifndef _XQUARTZ_LAUNCHD_FD_H_
+#define _XQUARTZ_LAUNCHD_FD_H_
+
+#define ERROR_FD -1
+
+int launchd_display_fd(void);
+
+#endif /* _XQUARTZ_LAUNCHD_FD_H_ */
\ No newline at end of file
diff --git a/hw/xquartz/quartzStartup.c b/hw/xquartz/quartzStartup.c
index ab43734..108d389 100644
--- a/hw/xquartz/quartzStartup.c
+++ b/hw/xquartz/quartzStartup.c
@@ -49,10 +49,14 @@
 #include <assert.h>
 #endif
 
+#include "launchd_fd.h"
+int xquartz_launchd_fd = -1;
+
 char **envpGlobal;      // argcGlobal and argvGlobal
                         // are from dix/globals.c
 
 static void server_thread (void *arg) {
+  xquartz_launchd_fd = launchd_display_fd();
   extern int main(int argc, char **argv, char **envp);
   exit (main (argcGlobal, argvGlobal, envpGlobal));
 }


More information about the xorg-commit mailing list