xserver: Branch 'xorg-server-1.5-apple' - 11 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Thu May 8 19:57:53 PDT 2008


 .gitignore                            |    5 -
 configure.ac                          |    6 +
 hw/xfree86/common/xf86AutoConfig.c    |    6 +
 hw/xfree86/xaa/xaaInit.c              |    4 
 hw/xfree86/xaa/xaaPict.c              |  144 -------------------------------
 hw/xquartz/Makefile.am                |    3 
 hw/xquartz/bundle/Info.plist          |    2 
 hw/xquartz/bundle/Makefile.am         |    1 
 hw/xquartz/bundle/bundle-main.c       |  143 -------------------------------
 hw/xquartz/bundle/mk_bundke.sh        |   33 ++-----
 hw/xquartz/doc/Makefile.am            |   14 +++
 hw/xquartz/doc/Xquartz.man.pre        |  156 ++++++++++++++++++++++++++++++++++
 hw/xquartz/mach-startup/Makefile.am   |   34 +++++++
 hw/xquartz/mach-startup/bundle-main.c |  143 +++++++++++++++++++++++++++++++
 hw/xquartz/mach-startup/stub.c        |   96 ++++++++++++++++++++
 hw/xquartz/stub/Makefile.am           |   11 --
 hw/xquartz/stub/stub.c                |   96 --------------------
 hw/xquartz/xpr/Makefile.am            |   34 -------
 hw/xquartz/xpr/Xquartz.man.pre        |  156 ----------------------------------
 mi/mivaltree.c                        |    4 
 xkb/ddxLoad.c                         |   54 ++++++-----
 21 files changed, 511 insertions(+), 634 deletions(-)

New commits:
commit e2431ff4881e103ce43e8f658af4198012694487
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Thu May 8 19:46:03 2008 -0700

    XQuartz: Reorganized some of the build system in prep for the Mach IPC startup work.
    (cherry picked from commit 2232c91d5c277673929eab2abb5e0495c00877cb)

diff --git a/configure.ac b/configure.ac
index fee5196..efd6786 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2204,7 +2204,8 @@ hw/xwin/Makefile
 hw/xquartz/Makefile
 hw/xquartz/GL/Makefile
 hw/xquartz/bundle/Makefile
-hw/xquartz/stub/Makefile
+hw/xquartz/doc/Makefile
+hw/xquartz/mach-startup/Makefile
 hw/xquartz/xpr/Makefile
 hw/kdrive/Makefile
 hw/kdrive/ati/Makefile
diff --git a/hw/xquartz/Makefile.am b/hw/xquartz/Makefile.am
index bbd21f8..77d662f 100644
--- a/hw/xquartz/Makefile.am
+++ b/hw/xquartz/Makefile.am
@@ -9,12 +9,11 @@ AM_CPPFLAGS = \
 	-DXFree86Server \
 	-I$(top_srcdir)/miext/rootless
 
-SUBDIRS = bundle . GL xpr stub
+SUBDIRS = bundle . GL xpr mach-startup doc
 
 libXquartz_la_SOURCES = \
 	$(top_srcdir)/fb/fbcmap_mi.c \
 	$(top_srcdir)/mi/miinitext.c \
-	bundle/bundle-main.c \
 	X11Application.m \
 	X11Controller.m \
 	applewm.c \
diff --git a/hw/xquartz/bundle/Makefile.am b/hw/xquartz/bundle/Makefile.am
index c61b049..a8f45f8 100644
--- a/hw/xquartz/bundle/Makefile.am
+++ b/hw/xquartz/bundle/Makefile.am
@@ -7,7 +7,6 @@ resource_DATA = Xquartz.plist
 EXTRA_DIST = \
 	mk_bundke.sh \
 	$(resource_DATA) \
-	bundle-main.c \
 	Resources/da.lproj/InfoPlist.strings \
 	Resources/da.lproj/Localizable.strings \
 	Resources/da.lproj/main.nib/keyedobjects.nib \
diff --git a/hw/xquartz/bundle/bundle-main.c b/hw/xquartz/bundle/bundle-main.c
deleted file mode 100644
index 042fa3a..0000000
--- a/hw/xquartz/bundle/bundle-main.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/* main.c -- X application launcher
- 
- Copyright (c) 2007 Jeremy Huddleston
- Copyright (c) 2007 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 <X11/Xlib.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include <CoreFoundation/CoreFoundation.h>
-
-#define DEFAULT_CLIENT "/usr/X11/bin/xterm"
-#define DEFAULT_STARTX "/usr/X11/bin/startx"
-#define DEFAULT_SHELL  "/bin/sh"
-
-static int execute(const char *command);
-static char *command_from_prefs(const char *key, const char *default_value);
-
-int server_main(int argc, char **argv, char **envp);
-
-int main(int argc, char **argv, char **envp) {
-    Display *display;
-    const char *s;
-
-    size_t i;
-    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]);
-    }
-    
-    /* Take care of the case where we're called like a normal DDX */
-    if(argc > 1 && argv[1][0] == ':') {
-        exit(server_main(argc, argv, envp));
-    }
-    
-    /* If we have a process serial number and it's our only arg, act as if
-     * the user double clicked the app bundle: launch app_to_run if possible
-     */
-    if(argc == 1 || (argc == 2 && !strncmp(argv[1], "-psn_", 5))) {
-        /* 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));
-        }
-    }
-
-    /* Start the server */
-    if((s = getenv("DISPLAY"))) {
-        fprintf(stderr, "X11.app: Could not connect to server (DISPLAY=\"%s\", unsetting).  Starting X server.\n", s);
-        unsetenv("DISPLAY");
-    } else {
-        fprintf(stderr, "X11.app: Could not connect to server (DISPLAY is not set).  Starting X server.\n");
-    }
-    return execute(command_from_prefs("startx_script", DEFAULT_STARTX));
-}
-
-static int execute(const char *command) {
-    const char *newargv[7];
-    const char **s;
-
-    newargv[0] = "/usr/bin/login";
-    newargv[1] = "-fp";
-    newargv[2] = getlogin();
-    newargv[3] = command_from_prefs("login_shell", DEFAULT_SHELL);
-    newargv[4] = "-c";
-    newargv[5] = command;
-    newargv[6] = NULL;
-    
-    fprintf(stderr, "X11.app: Launching %s:\n", command);
-    for(s=newargv; *s; s++) {
-        fprintf(stderr, "\targv[%d] = %s\n", s - newargv, *s);
-    }
-
-    execvp (newargv[0], (char * const *) newargv);
-    perror ("X11.app: Couldn't exec.");
-    return(1);
-}
-
-static char *command_from_prefs(const char *key, const char *default_value) {
-    char *command = NULL;
-    
-    CFStringRef cfKey = CFStringCreateWithCString(NULL, key, kCFStringEncodingASCII);
-    CFPropertyListRef PlistRef = CFPreferencesCopyAppValue(cfKey, kCFPreferencesCurrentApplication);
-    
-    if ((PlistRef == NULL) || (CFGetTypeID(PlistRef) != CFStringGetTypeID())) {
-        CFStringRef cfDefaultValue = CFStringCreateWithCString(NULL, default_value, kCFStringEncodingASCII);
-
-        CFPreferencesSetAppValue(cfKey, cfDefaultValue, kCFPreferencesCurrentApplication);
-        CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
-        
-        int len = strlen(default_value) + 1;
-        command = (char *)malloc(len * sizeof(char));
-        if(!command)
-            return NULL;
-        strcpy(command, default_value);
-    } else {
-        int len = CFStringGetLength((CFStringRef)PlistRef) + 1;
-        command = (char *)malloc(len * sizeof(char));
-        if(!command)
-            return NULL;
-        CFStringGetCString((CFStringRef)PlistRef, command, len,  kCFStringEncodingASCII);
-	}
-    
-    if (PlistRef)
-        CFRelease(PlistRef);
-    
-    return command;
-}
diff --git a/hw/xquartz/doc/Makefile.am b/hw/xquartz/doc/Makefile.am
new file mode 100644
index 0000000..b812af1
--- /dev/null
+++ b/hw/xquartz/doc/Makefile.am
@@ -0,0 +1,14 @@
+appmandir = $(APP_MAN_DIR)
+appman_PRE = Xquartz.man.pre
+appman_PROCESSED = $(appman_PRE:man.pre=man)
+appman_DATA = $(appman_PRE:man.pre=@APP_MAN_SUFFIX@)
+
+CLEANFILES = $(appman_PROCESSED) $(appman_DATA)
+
+include $(top_srcdir)/cpprules.in
+
+.man.$(APP_MAN_SUFFIX):
+	cp $< $@
+
+EXTRA_DIST = \
+	Xquartz.man.pre
diff --git a/hw/xquartz/doc/Xquartz.man.pre b/hw/xquartz/doc/Xquartz.man.pre
new file mode 100644
index 0000000..315db1c
--- /dev/null
+++ b/hw/xquartz/doc/Xquartz.man.pre
@@ -0,0 +1,156 @@
+.TH XQUARTZ 1 __vendorversion__
+.SH NAME
+Xquartz \- X window system server for Quartz operating system
+.SH SYNOPSIS
+.B Xquartz
+[ options ] ...
+.SH DESCRIPTION
+.I Xquartz
+is the X window server for Mac OS X provided by Apple.
+.I Xquartz
+runs in parallel with Aqua in rootless mode. In rootless mode, the X
+window system and Mac OS X share your display.  The root window of the
+X11 display is the size of the screen and contains all the other
+windows. The X11 root window is not displayed in rootless mode as Mac
+OS X handles the desktop background.
+.SH OPTIONS
+.PP
+In addition to the normal server options described in the \fIXserver(1)\fP
+manual page, \fIXquartz\fP accepts the following command line switches:
+.TP 8
+.B \-fakebuttons
+Emulates a 3 button mouse using modifier keys. By default, the Command modifier
+is used to emulate button 2 and Option is used for button 3. Thus, clicking the
+first mouse button while holding down Command will act like clicking
+button 2. Holding down Option will simulate button 3.
+.TP 8
+.B \-nofakebuttons
+Do not emulate a 3 button mouse. This is the default.
+.TP 8
+.B "\-fakemouse2 \fImodifiers\fP"
+Change the modifier keys used to emulate the second mouse button. By default,
+Command is used to emulate the second button. Any combination of the following
+modifier names may be used: Shift, Option, Control, Command, Fn. For example,
+.B \-fakemouse2 """Option,Shift""
+will set holding Option, Shift and clicking on button one as equivalent to
+clicking the second mouse button.
+.TP 8
+.B "\-fakemouse3 \fImodifiers\fP"
+Change the modifier keys used to emulate the third mouse button. By default,
+Option is used to emulate the third button. Any combination of the following
+modifier names may be used: Shift, Option, Control, Command, Fn. For example,
+.B \-fakemouse3 """Control,Shift""
+will set holding Control, Shift and clicking on button one as equivalent to
+clicking the third mouse button.
+.TP 8
+.B "\-swapAltMeta"
+Swaps the meaning of the Alt and Meta modifier keys.
+.TP 8
+.B "\-keymap \fIfile\fP"
+On startup \fIXquartz\fP translates a Darwin keymapping into an X keymap.
+The default is to read this keymapping from USA.keymapping. With this option
+the keymapping will be read from \fIfile\fP instead. If the file's path is
+not specified, it will be searched for in Library/Keyboards/ underneath the
+following directories (in order): ~, /, /Network, /System.
+.TP 8
+.B \-nokeymap
+On startup \fIXquartz\fP translates a Darwin keymapping into an X keymap.
+With this option \fIXquartz\fP queries the kernel for the current keymapping
+instead of reading it from a file. This will often fail on newer kernels.
+.TP 8
+.B "\-depth \fIdepth\fP"
+Specifies the color bit depth to use. Currently only 15, and 24 color
+bits per pixel are supported. If not specified, defaults to the depth
+of the main display.
+.SH CUSTOMIZATION
+\fIXquartz\fP can also be customized using the defaults(1) command. The available options are:
+.TP 8
+.B defaults write org.x.X11 enable_fake_buttons -boolean true
+Equivalent to the \fB-fakebuttons\fP command line option.
+.TP 8
+.B defaults write org.x.X11 fake_button2 \fImodifiers\fP
+Equivalent to the \fB-fakemouse2\fP option.
+.TP 8
+.B defaults write org.x.X11 fake_button3 \fImodifiers\fP
+Equivalent to the \fB-fakemouse3\fP option.
+.TP 8
+.B defaults write org.x.X11 swap_alt_meta -boolean true
+Equivalent to the \fB-swapAltMeta\fP option.
+.TP 8
+.B defaults write org.x.X11 keymap_file \fIfilename\fP
+Equivalent to the \fB-keymap\fP option.
+.TP 8
+.B defaults write org.x.X11 no_quit_alert -boolean true
+Disables the alert dialog displayed when attempting to quit X11.
+.TP 8
+.B defaults write org.x.X11 no_auth -boolean true
+Stops the X server requiring that clients authenticate themselves when
+connecting. See Xsecurity(__miscmansuffix__).
+.TP 8
+.B defaults write org.x.X11 nolisten_tcp -boolean true
+Prevents the X server accepting remote connections.
+.TP 8
+.B defaults write org.x.X11 xinit_kills_server -boolean false
+Stops the X server exiting when the xinitrc script terminates.
+.TP 8
+.B defaults write org.x.X11 fullscreen_hotkeys -boolean false
+Allows system hotkeys to be handled while in X11 fullscreen mode.
+.TP 8
+.B defaults write org.x.X11 enable_system_beep -boolean false
+Don't use the standard system beep effect for X11 alerts.
+.TP 8
+.B defaults write org.x.X11 enable_key_equivalents -boolean false
+Disable menu keyboard equivalents while X11 windows are focused.
+.TP 8
+.B defaults write org.x.X11 depth \fIdepth\fP
+Equivalent to the \fB-depth\fP option.
+.SH "SEE ALSO"
+.PP
+X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1)
+.PP
+.SH AUTHORS
+XFree86 was originally ported to Mac OS X Server by John Carmack. Dave
+Zarzycki used this as the basis of his port of XFree86 4.0 to Darwin 1.0.
+Torrey T. Lyons improved and integrated this code into the XFree86
+Project's mainline for the 4.0.2 release.
+.PP
+The following members of the XonX Team contributed to the following
+releases (in alphabetical order):
+.TP 4
+XFree86 4.1.0:
+.br
+Rob Braun - Darwin x86 support
+.br
+Torrey T. Lyons - Project Lead
+.br
+Andreas Monitzer - Cocoa version of XDarwin front end
+.br
+Gregory Robert Parker - Original Quartz implementation
+.br
+Christoph Pfisterer - Dynamic shared X libraries
+.br
+Toshimitsu Tanaka - Japanese localization
+.TP 4
+XFree86 4.2.0:
+.br
+Rob Braun - Darwin x86 support
+.br
+Pablo Di Noto - Spanish localization
+.br
+Paul Edens - Dutch localization
+.br
+Kyunghwan Kim - Korean localization
+.br
+Mario Klebsch - Non-US keyboard support
+.br
+Torrey T. Lyons - Project Lead
+.br
+Andreas Monitzer - German localization
+.br
+Patrik Montgomery - Swedish localization
+.br
+Greg Parker - Rootless support
+.br
+Toshimitsu Tanaka - Japanese localization
+.br
+Olivier Verdier - French localization
diff --git a/hw/xquartz/mach-startup/Makefile.am b/hw/xquartz/mach-startup/Makefile.am
new file mode 100644
index 0000000..9668711
--- /dev/null
+++ b/hw/xquartz/mach-startup/Makefile.am
@@ -0,0 +1,34 @@
+AM_CPPFLAGS = \
+	-DBUILD_DATE=\"$(BUILD_DATE)\" \
+	-DXSERVER_VERSION=\"$(VERSION)\"
+
+x11appdir = $(APPLE_APPLICATIONS_DIR)/X11.app/Contents/MacOS
+x11app_PROGRAMS = X11
+
+X11_SOURCES = \
+	bundle-main.c
+
+X11_LDADD = \
+	$(top_builddir)/hw/xquartz/libXquartz.la \
+	$(top_builddir)/hw/xquartz/xpr/libXquartzXpr.la \
+	$(top_builddir)/dix/dixfonts.lo \
+	$(top_builddir)/miext/rootless/librootless.la \
+	$(DARWIN_LIBS) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) -lXplugin -lX11
+
+X11_LDFLAGS =  \
+	-XCClinker -Objc \
+	-Wl,-u,_miDCInitialize \
+	-Wl,-framework,Carbon \
+	-L/System/Library/Frameworks/OpenGL.framework/Libraries -lGL \
+	-Wl,-framework,OpenGL \
+	-Wl,-framework,Cocoa \
+	-Wl,-framework,CoreAudio \
+	-Wl,-framework,IOKit
+
+bin_PROGRAMS = Xquartz
+
+Xquartz_SOURCES = \
+	stub.c
+
+Xquartz_LDFLAGS =  \
+	-Wl,-framework,CoreServices
diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c
new file mode 100644
index 0000000..042fa3a
--- /dev/null
+++ b/hw/xquartz/mach-startup/bundle-main.c
@@ -0,0 +1,143 @@
+/* main.c -- X application launcher
+ 
+ Copyright (c) 2007 Jeremy Huddleston
+ Copyright (c) 2007 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 <X11/Xlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <CoreFoundation/CoreFoundation.h>
+
+#define DEFAULT_CLIENT "/usr/X11/bin/xterm"
+#define DEFAULT_STARTX "/usr/X11/bin/startx"
+#define DEFAULT_SHELL  "/bin/sh"
+
+static int execute(const char *command);
+static char *command_from_prefs(const char *key, const char *default_value);
+
+int server_main(int argc, char **argv, char **envp);
+
+int main(int argc, char **argv, char **envp) {
+    Display *display;
+    const char *s;
+
+    size_t i;
+    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]);
+    }
+    
+    /* Take care of the case where we're called like a normal DDX */
+    if(argc > 1 && argv[1][0] == ':') {
+        exit(server_main(argc, argv, envp));
+    }
+    
+    /* If we have a process serial number and it's our only arg, act as if
+     * the user double clicked the app bundle: launch app_to_run if possible
+     */
+    if(argc == 1 || (argc == 2 && !strncmp(argv[1], "-psn_", 5))) {
+        /* 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));
+        }
+    }
+
+    /* Start the server */
+    if((s = getenv("DISPLAY"))) {
+        fprintf(stderr, "X11.app: Could not connect to server (DISPLAY=\"%s\", unsetting).  Starting X server.\n", s);
+        unsetenv("DISPLAY");
+    } else {
+        fprintf(stderr, "X11.app: Could not connect to server (DISPLAY is not set).  Starting X server.\n");
+    }
+    return execute(command_from_prefs("startx_script", DEFAULT_STARTX));
+}
+
+static int execute(const char *command) {
+    const char *newargv[7];
+    const char **s;
+
+    newargv[0] = "/usr/bin/login";
+    newargv[1] = "-fp";
+    newargv[2] = getlogin();
+    newargv[3] = command_from_prefs("login_shell", DEFAULT_SHELL);
+    newargv[4] = "-c";
+    newargv[5] = command;
+    newargv[6] = NULL;
+    
+    fprintf(stderr, "X11.app: Launching %s:\n", command);
+    for(s=newargv; *s; s++) {
+        fprintf(stderr, "\targv[%d] = %s\n", s - newargv, *s);
+    }
+
+    execvp (newargv[0], (char * const *) newargv);
+    perror ("X11.app: Couldn't exec.");
+    return(1);
+}
+
+static char *command_from_prefs(const char *key, const char *default_value) {
+    char *command = NULL;
+    
+    CFStringRef cfKey = CFStringCreateWithCString(NULL, key, kCFStringEncodingASCII);
+    CFPropertyListRef PlistRef = CFPreferencesCopyAppValue(cfKey, kCFPreferencesCurrentApplication);
+    
+    if ((PlistRef == NULL) || (CFGetTypeID(PlistRef) != CFStringGetTypeID())) {
+        CFStringRef cfDefaultValue = CFStringCreateWithCString(NULL, default_value, kCFStringEncodingASCII);
+
+        CFPreferencesSetAppValue(cfKey, cfDefaultValue, kCFPreferencesCurrentApplication);
+        CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
+        
+        int len = strlen(default_value) + 1;
+        command = (char *)malloc(len * sizeof(char));
+        if(!command)
+            return NULL;
+        strcpy(command, default_value);
+    } else {
+        int len = CFStringGetLength((CFStringRef)PlistRef) + 1;
+        command = (char *)malloc(len * sizeof(char));
+        if(!command)
+            return NULL;
+        CFStringGetCString((CFStringRef)PlistRef, command, len,  kCFStringEncodingASCII);
+	}
+    
+    if (PlistRef)
+        CFRelease(PlistRef);
+    
+    return command;
+}
diff --git a/hw/xquartz/mach-startup/stub.c b/hw/xquartz/mach-startup/stub.c
new file mode 100644
index 0000000..70f222c
--- /dev/null
+++ b/hw/xquartz/mach-startup/stub.c
@@ -0,0 +1,96 @@
+/* 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 <CoreServices/CoreServices.h>
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#define kX11AppBundleId "org.x.X11"
+#define kX11AppBundlePath "/Contents/MacOS/X11"
+
+static char x11_path[PATH_MAX + 1];
+
+static void set_x11_path() {
+    CFURLRef appURL = NULL;
+    OSStatus osstatus = LSFindApplicationForInfo(kLSUnknownCreator, CFSTR(kX11AppBundleId), nil, nil, &appURL);
+    
+    switch (osstatus) {
+        case noErr:
+            if (appURL == NULL) {
+                fprintf(stderr, "xinit: Invalid response from LSFindApplicationForInfo(%s)\n", 
+                        kX11AppBundleId);
+                exit(1);
+            }
+            
+            if (!CFURLGetFileSystemRepresentation(appURL, true, (unsigned char *)x11_path, sizeof(x11_path))) {
+                fprintf(stderr, "xinit: Error resolving URL for %s\n", kX11AppBundleId);
+                exit(2);
+            }
+            
+            strlcat(x11_path, kX11AppBundlePath, sizeof(x11_path));
+#ifdef DEBUG
+            fprintf(stderr, "XQuartz: X11.app = %s\n", x11_path);
+#endif
+            break;
+        case kLSApplicationNotFoundErr:
+            fprintf(stderr, "XQuartz: Unable to find application for %s\n", kX11AppBundleId);
+            exit(4);
+        default:
+            fprintf(stderr, "XQuartz: Unable to find application for %s, error code = %d\n", 
+                    kX11AppBundleId, (int)osstatus);
+            exit(5);
+    }
+}
+
+#ifndef BUILD_DATE
+#define BUILD_DATE "?"
+#endif
+#ifndef XSERVER_VERSION
+#define XSERVER_VERSION "?"
+#endif
+
+int main(int argc, char **argv) {
+    
+    if(argc == 2 && !strcmp(argv[1], "-version")) {
+        fprintf(stderr, "X.org Release 7.3\n");
+        fprintf(stderr, "X.Org X Server %s\n", XSERVER_VERSION);
+        fprintf(stderr, "Build Date: %s\n", BUILD_DATE);
+        return 0;
+    }
+    
+    set_x11_path();
+    
+    argv[0] = x11_path;
+    return execvp(x11_path, argv);
+}
diff --git a/hw/xquartz/stub/Makefile.am b/hw/xquartz/stub/Makefile.am
deleted file mode 100644
index 3752dc1..0000000
--- a/hw/xquartz/stub/Makefile.am
+++ /dev/null
@@ -1,11 +0,0 @@
-AM_CPPFLAGS = \
-	-DBUILD_DATE=\"$(BUILD_DATE)\" \
-	-DXSERVER_VERSION=\"$(VERSION)\"
-
-bin_PROGRAMS = Xquartz
-
-Xquartz_SOURCES = \
-	stub.c
-
-Xquartz_LDFLAGS =  \
-	-framework CoreServices
diff --git a/hw/xquartz/stub/stub.c b/hw/xquartz/stub/stub.c
deleted file mode 100644
index 70f222c..0000000
--- a/hw/xquartz/stub/stub.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/* 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 <CoreServices/CoreServices.h>
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <string.h>
-#include <stdio.h>
-#include <unistd.h>
-
-#define kX11AppBundleId "org.x.X11"
-#define kX11AppBundlePath "/Contents/MacOS/X11"
-
-static char x11_path[PATH_MAX + 1];
-
-static void set_x11_path() {
-    CFURLRef appURL = NULL;
-    OSStatus osstatus = LSFindApplicationForInfo(kLSUnknownCreator, CFSTR(kX11AppBundleId), nil, nil, &appURL);
-    
-    switch (osstatus) {
-        case noErr:
-            if (appURL == NULL) {
-                fprintf(stderr, "xinit: Invalid response from LSFindApplicationForInfo(%s)\n", 
-                        kX11AppBundleId);
-                exit(1);
-            }
-            
-            if (!CFURLGetFileSystemRepresentation(appURL, true, (unsigned char *)x11_path, sizeof(x11_path))) {
-                fprintf(stderr, "xinit: Error resolving URL for %s\n", kX11AppBundleId);
-                exit(2);
-            }
-            
-            strlcat(x11_path, kX11AppBundlePath, sizeof(x11_path));
-#ifdef DEBUG
-            fprintf(stderr, "XQuartz: X11.app = %s\n", x11_path);
-#endif
-            break;
-        case kLSApplicationNotFoundErr:
-            fprintf(stderr, "XQuartz: Unable to find application for %s\n", kX11AppBundleId);
-            exit(4);
-        default:
-            fprintf(stderr, "XQuartz: Unable to find application for %s, error code = %d\n", 
-                    kX11AppBundleId, (int)osstatus);
-            exit(5);
-    }
-}
-
-#ifndef BUILD_DATE
-#define BUILD_DATE "?"
-#endif
-#ifndef XSERVER_VERSION
-#define XSERVER_VERSION "?"
-#endif
-
-int main(int argc, char **argv) {
-    
-    if(argc == 2 && !strcmp(argv[1], "-version")) {
-        fprintf(stderr, "X.org Release 7.3\n");
-        fprintf(stderr, "X.Org X Server %s\n", XSERVER_VERSION);
-        fprintf(stderr, "Build Date: %s\n", BUILD_DATE);
-        return 0;
-    }
-    
-    set_x11_path();
-    
-    argv[0] = x11_path;
-    return execvp(x11_path, argv);
-}
diff --git a/hw/xquartz/xpr/Makefile.am b/hw/xquartz/xpr/Makefile.am
index 6bf99a4..e74580f 100644
--- a/hw/xquartz/xpr/Makefile.am
+++ b/hw/xquartz/xpr/Makefile.am
@@ -1,5 +1,4 @@
-x11appdir = $(APPLE_APPLICATIONS_DIR)/X11.app/Contents/MacOS
-x11app_PROGRAMS = X11
+noinst_LTLIBRARIES = libXquartzXpr.la
 
 AM_CFLAGS =  $(XSERVER_CFLAGS) $(DIX_CFLAGS)
 AM_CPPFLAGS = \
@@ -7,7 +6,7 @@ AM_CPPFLAGS = \
 	-I$(top_srcdir)/miext \
 	-I$(top_srcdir)/miext/rootless
 
-X11_SOURCES = \
+libXquartzXpr_la_SOURCES = \
 	appledri.c \
 	dri.c \
 	xprAppleWM.c \
@@ -19,36 +18,7 @@ X11_SOURCES = \
 	x-hook.c \
 	x-list.c
 
-X11_LDADD = \
-	$(top_builddir)/hw/xquartz/libXquartz.la \
-	$(top_builddir)/dix/dixfonts.lo \
-	$(top_builddir)/miext/rootless/librootless.la \
-	$(DARWIN_LIBS) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) -lXplugin -lX11
-
-X11_LDFLAGS =  \
-	-XCClinker -Objc \
-	-Wl,-u,_miDCInitialize \
-	-Wl,-framework,Carbon \
-	-L/System/Library/Frameworks/OpenGL.framework/Libraries -lGL \
-	-Wl,-framework,OpenGL \
-	-Wl,-framework,Cocoa \
-	-Wl,-framework,CoreAudio \
-	-Wl,-framework,IOKit
-
-appmandir = $(APP_MAN_DIR)
-appman_PRE = Xquartz.man.pre
-appman_PROCESSED = $(appman_PRE:man.pre=man)
-appman_DATA = $(appman_PRE:man.pre=@APP_MAN_SUFFIX@)
-
-CLEANFILES = $(appman_PROCESSED) $(appman_DATA)
-
-include $(top_srcdir)/cpprules.in
-
-.man.$(APP_MAN_SUFFIX):
-	cp $< $@
-
 EXTRA_DIST = \
-	Xquartz.man.pre \
 	dri.h \
 	dristruct.h \
 	appledri.h \
diff --git a/hw/xquartz/xpr/Xquartz.man.pre b/hw/xquartz/xpr/Xquartz.man.pre
deleted file mode 100644
index 315db1c..0000000
--- a/hw/xquartz/xpr/Xquartz.man.pre
+++ /dev/null
@@ -1,156 +0,0 @@
-.TH XQUARTZ 1 __vendorversion__
-.SH NAME
-Xquartz \- X window system server for Quartz operating system
-.SH SYNOPSIS
-.B Xquartz
-[ options ] ...
-.SH DESCRIPTION
-.I Xquartz
-is the X window server for Mac OS X provided by Apple.
-.I Xquartz
-runs in parallel with Aqua in rootless mode. In rootless mode, the X
-window system and Mac OS X share your display.  The root window of the
-X11 display is the size of the screen and contains all the other
-windows. The X11 root window is not displayed in rootless mode as Mac
-OS X handles the desktop background.
-.SH OPTIONS
-.PP
-In addition to the normal server options described in the \fIXserver(1)\fP
-manual page, \fIXquartz\fP accepts the following command line switches:
-.TP 8
-.B \-fakebuttons
-Emulates a 3 button mouse using modifier keys. By default, the Command modifier
-is used to emulate button 2 and Option is used for button 3. Thus, clicking the
-first mouse button while holding down Command will act like clicking
-button 2. Holding down Option will simulate button 3.
-.TP 8
-.B \-nofakebuttons
-Do not emulate a 3 button mouse. This is the default.
-.TP 8
-.B "\-fakemouse2 \fImodifiers\fP"
-Change the modifier keys used to emulate the second mouse button. By default,
-Command is used to emulate the second button. Any combination of the following
-modifier names may be used: Shift, Option, Control, Command, Fn. For example,
-.B \-fakemouse2 """Option,Shift""
-will set holding Option, Shift and clicking on button one as equivalent to
-clicking the second mouse button.
-.TP 8
-.B "\-fakemouse3 \fImodifiers\fP"
-Change the modifier keys used to emulate the third mouse button. By default,
-Option is used to emulate the third button. Any combination of the following
-modifier names may be used: Shift, Option, Control, Command, Fn. For example,
-.B \-fakemouse3 """Control,Shift""
-will set holding Control, Shift and clicking on button one as equivalent to
-clicking the third mouse button.
-.TP 8
-.B "\-swapAltMeta"
-Swaps the meaning of the Alt and Meta modifier keys.
-.TP 8
-.B "\-keymap \fIfile\fP"
-On startup \fIXquartz\fP translates a Darwin keymapping into an X keymap.
-The default is to read this keymapping from USA.keymapping. With this option
-the keymapping will be read from \fIfile\fP instead. If the file's path is
-not specified, it will be searched for in Library/Keyboards/ underneath the
-following directories (in order): ~, /, /Network, /System.
-.TP 8
-.B \-nokeymap
-On startup \fIXquartz\fP translates a Darwin keymapping into an X keymap.
-With this option \fIXquartz\fP queries the kernel for the current keymapping
-instead of reading it from a file. This will often fail on newer kernels.
-.TP 8
-.B "\-depth \fIdepth\fP"
-Specifies the color bit depth to use. Currently only 15, and 24 color
-bits per pixel are supported. If not specified, defaults to the depth
-of the main display.
-.SH CUSTOMIZATION
-\fIXquartz\fP can also be customized using the defaults(1) command. The available options are:
-.TP 8
-.B defaults write org.x.X11 enable_fake_buttons -boolean true
-Equivalent to the \fB-fakebuttons\fP command line option.
-.TP 8
-.B defaults write org.x.X11 fake_button2 \fImodifiers\fP
-Equivalent to the \fB-fakemouse2\fP option.
-.TP 8
-.B defaults write org.x.X11 fake_button3 \fImodifiers\fP
-Equivalent to the \fB-fakemouse3\fP option.
-.TP 8
-.B defaults write org.x.X11 swap_alt_meta -boolean true
-Equivalent to the \fB-swapAltMeta\fP option.
-.TP 8
-.B defaults write org.x.X11 keymap_file \fIfilename\fP
-Equivalent to the \fB-keymap\fP option.
-.TP 8
-.B defaults write org.x.X11 no_quit_alert -boolean true
-Disables the alert dialog displayed when attempting to quit X11.
-.TP 8
-.B defaults write org.x.X11 no_auth -boolean true
-Stops the X server requiring that clients authenticate themselves when
-connecting. See Xsecurity(__miscmansuffix__).
-.TP 8
-.B defaults write org.x.X11 nolisten_tcp -boolean true
-Prevents the X server accepting remote connections.
-.TP 8
-.B defaults write org.x.X11 xinit_kills_server -boolean false
-Stops the X server exiting when the xinitrc script terminates.
-.TP 8
-.B defaults write org.x.X11 fullscreen_hotkeys -boolean false
-Allows system hotkeys to be handled while in X11 fullscreen mode.
-.TP 8
-.B defaults write org.x.X11 enable_system_beep -boolean false
-Don't use the standard system beep effect for X11 alerts.
-.TP 8
-.B defaults write org.x.X11 enable_key_equivalents -boolean false
-Disable menu keyboard equivalents while X11 windows are focused.
-.TP 8
-.B defaults write org.x.X11 depth \fIdepth\fP
-Equivalent to the \fB-depth\fP option.
-.SH "SEE ALSO"
-.PP
-X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1)
-.PP
-.SH AUTHORS
-XFree86 was originally ported to Mac OS X Server by John Carmack. Dave
-Zarzycki used this as the basis of his port of XFree86 4.0 to Darwin 1.0.
-Torrey T. Lyons improved and integrated this code into the XFree86
-Project's mainline for the 4.0.2 release.
-.PP
-The following members of the XonX Team contributed to the following
-releases (in alphabetical order):
-.TP 4
-XFree86 4.1.0:
-.br
-Rob Braun - Darwin x86 support
-.br
-Torrey T. Lyons - Project Lead
-.br
-Andreas Monitzer - Cocoa version of XDarwin front end
-.br
-Gregory Robert Parker - Original Quartz implementation
-.br
-Christoph Pfisterer - Dynamic shared X libraries
-.br
-Toshimitsu Tanaka - Japanese localization
-.TP 4
-XFree86 4.2.0:
-.br
-Rob Braun - Darwin x86 support
-.br
-Pablo Di Noto - Spanish localization
-.br
-Paul Edens - Dutch localization
-.br
-Kyunghwan Kim - Korean localization
-.br
-Mario Klebsch - Non-US keyboard support
-.br
-Torrey T. Lyons - Project Lead
-.br
-Andreas Monitzer - German localization
-.br
-Patrik Montgomery - Swedish localization
-.br
-Greg Parker - Rootless support
-.br
-Toshimitsu Tanaka - Japanese localization
-.br
-Olivier Verdier - French localization
commit 7ee9600e77e0a06de8683e6fdac38cf5c9a3e9fb
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Thu May 8 19:47:40 2008 -0700

    Updated .gitignore for new Xquartz layout
    (cherry picked from commit cd4d2355e227549a3410485a130549dd91ccdcfe)

diff --git a/.gitignore b/.gitignore
index 5d216fb..00681e7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -276,8 +276,9 @@ hw/xprint/doc/Xprt.1x
 hw/xprint/doc/Xprt.man
 hw/xprint/dpmsstubs-wrapper.c
 hw/xprint/miinitext-wrapper.c
-hw/xquartz/xpr/Xquartz
-hw/xquartz/xpr/Xquartz.1
+hw/xquartz/mach-startup/X11
+hw/xquartz/mach-startup/Xquartz
+hw/xquartz/doc/Xquartz.1
 include/dix-config.h
 include/kdrive-config.h
 include/xgl-config.h
commit d6cf35fc56840715e5cb87d1de157176eb449c20
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Thu May 8 16:57:42 2008 -0700

    XQuartz: Set bundle version to 2.3.0
    (cherry picked from commit 8a0524b30e1e860f3ae35741c116fc8da28aef79)

diff --git a/hw/xquartz/bundle/Info.plist b/hw/xquartz/bundle/Info.plist
index 6ba02dd..4b0830f 100644
--- a/hw/xquartz/bundle/Info.plist
+++ b/hw/xquartz/bundle/Info.plist
@@ -19,7 +19,7 @@
 	<key>CFBundlePackageType</key>
 		<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-		<string>2.2.0</string>
+		<string>2.3.0</string>
 	<key>CFBundleSignature</key>
 		<string>x11a</string>
 	<key>CSResourcesFileMapped</key>
commit 561ece68eae1df78c01622f8428823c53935eb74
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Tue May 6 16:12:41 2008 -0700

    XQuartz: Fixed some issue in our bundle creation
    (cherry picked from commit 330ffad5477e32c5ab9ed338bc628bd5ae9f4c98)

diff --git a/hw/xquartz/bundle/mk_bundke.sh b/hw/xquartz/bundle/mk_bundke.sh
index 750af9c..0b2a144 100755
--- a/hw/xquartz/bundle/mk_bundke.sh
+++ b/hw/xquartz/bundle/mk_bundke.sh
@@ -4,31 +4,22 @@
 
 BUNDLE_ROOT=$1
 
-mkdir -p ${BUNDLE_ROOT}/Contents/MacOS
-[ -d ${BUNDLE_ROOT}/Contents/MacOS ] || exit 1
-
-mkdir -p ${BUNDLE_ROOT}/Contents/Resources/English.lproj/main.nib
-[ -d ${BUNDLE_ROOT}/Contents/Resources/English.lproj/main.nib ] || exit 1
-
-if [[ $(id -u) == 0 ]] ; then
-	OWNERSHIP="-o root -g admin"
-else
-	OWNERSHIP=""
-fi
-
 localities="Dutch English French German Italian Japanese Spanish da fi ko no pl pt pt_PT ru sv zh_CN zh_TW"
 for lang in ${localities} ; do
+    mkdir -p ${BUNDLE_ROOT}/Contents/Resources/${lang}.lproj/main.nib
+    [ -d ${BUNDLE_ROOT}/Contents/Resources/${lang}.lproj/main.nib ] || exit 1
+
     for f in InfoPlist.strings Localizable.strings main.nib/keyedobjects.nib ; do
-	if [[ $(id -u) == 0 ]] ; then
-	        install ${OWNERSHIP} -m 644 Resources/${lang}.lproj/$f ${BUNDLE_ROOT}/Contents/Resources/${lang}.lproj/${f}
-	else
-	        install ${OWNERSHIP} -m 644 Resources/${lang}.lproj/$f ${BUNDLE_ROOT}/Contents/Resources/${lang}.lproj/${f}
-	fi
+        install -m 644 Resources/${lang}.lproj/$f ${BUNDLE_ROOT}/Contents/Resources/${lang}.lproj/${f}
     done
 done
 
-install ${OWNERSHIP} -m 644 Resources/English.lproj/main.nib//designable.nib ${BUNDLE_ROOT}/Contents/Resources/English.lproj/main.nib
-install ${OWNERSHIP} -m 644 Resources/X11.icns ${BUNDLE_ROOT}/Contents/Resources
+install -m 644 Resources/English.lproj/main.nib//designable.nib ${BUNDLE_ROOT}/Contents/Resources/English.lproj/main.nib
+install -m 644 Resources/X11.icns ${BUNDLE_ROOT}/Contents/Resources
+
+install -m 644 Info.plist ${BUNDLE_ROOT}/Contents
+install -m 644 PkgInfo ${BUNDLE_ROOT}/Contents
 
-install ${OWNERSHIP} -m 644 Info.plist ${BUNDLE_ROOT}/Contents
-install ${OWNERSHIP} -m 644 PkgInfo ${BUNDLE_ROOT}/Contents
+if [[ $(id -u) == 0 ]] ; then
+	chown -R root:admin ${BUNDLE_ROOT}
+fi
commit 1f0706062eaba07d42a3ba5909d6d538a1429cad
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Tue May 6 16:07:33 2008 -0700

    Set CSRG_BASED on OSX
    (cherry picked from commit ff085deba18682caa2f93d61a75b38db87d747b1)

diff --git a/configure.ac b/configure.ac
index 3229639..fee5196 100644
--- a/configure.ac
+++ b/configure.ac
@@ -401,6 +401,9 @@ case $host_os in
   *solaris*)
 	PKG_CHECK_EXISTS(libdrm, DRI=yes, DRI=no)
 	;;
+  darwin*)
+	AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
+	;;
 esac
 AM_CONDITIONAL(KDRIVE_HW, test "x$KDRIVE_HW" = xyes)
 
commit 50ce5f2083a01d85f1994a627669722b325f9656
Merge: 4f0a975... 64948dc...
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Thu May 8 19:55:25 2008 -0700

    Merge branch 'server-1.5-branch' into xorg-server-1.5-apple

commit 64948dc667fb6841147e87dafd5711b544511cf1
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu May 8 16:04:24 2008 -0400

    Bug #13104: Remove broken XAA a1 glyph fast path.
    
    (cherry picked from commit f17ba5d5849c92603f453195aca384844ca76d74)

diff --git a/hw/xfree86/xaa/xaaPict.c b/hw/xfree86/xaa/xaaPict.c
index 74e90e3..784c649 100644
--- a/hw/xfree86/xaa/xaaPict.c
+++ b/hw/xfree86/xaa/xaaPict.c
@@ -588,150 +588,6 @@ XAADoGlyphs (CARD8         op,
         IS_OFFSCREEN_PIXMAP(pSrc->pDrawable))
         return FALSE;
 
-    if(maskFormat && (maskFormat->depth == 1) && 
-       (pSrc->pDrawable->width == 1) && (pSrc->pDrawable->height == 1) &&
-       (op == PictOpOver) && infoRec->WriteBitmap &&
-       !(infoRec->WriteBitmapFlags & NO_TRANSPARENCY))
-    {
-	CARD16 red, green, blue, alpha;
-	CARD32 pixel =
-                *((CARD32*)(((PixmapPtr)(pSrc->pDrawable))->devPrivate.ptr));
-	CARD32 *bits, *pntr, *pnt;
-	int x, y, i, n, left, top, right, bottom, width, height, pitch;
-	int L, T, R, B, X, Y, h, w, dwords, row, column, nbox;
-	int leftEdge, rightEdge, topLine, botLine;
-	BoxPtr pbox;
-	GlyphPtr glyph;
-	
-	if(!XAAGetRGBAFromPixel(pixel,&red,&green,&blue,&alpha,pSrc->format))
-		return FALSE;
-
-	if(alpha != 0xffff) return FALSE;
-
-	XAAGetPixelFromRGBA(&pixel, red, green, blue, 0, pDst->format);
-
-	if((infoRec->WriteBitmapFlags & RGB_EQUAL) && !((red == green) && (green == blue)))
-	   return FALSE;
-
-	x = pDst->pDrawable->x;
-	y = pDst->pDrawable->y;
-
-	while(nlist--) {
-	    x += list->xOff;
-	    y += list->yOff;
-	    left = right = X = x;
-	    top = bottom = Y = y;
-	    for(i = 0; i < list->len; i++) {
-		glyph = glyphs[i];
-
-		L = X - glyph->info.x;
-		if(L < left) left = L;
-		R = L + glyph->info.width;
-		if(R > right) right = R;
-
-		T = Y - glyph->info.y;
-		if(T < top) top = T;
-		B = T + glyph->info.height;
-		if(B > bottom) bottom = B;
-
-		X += glyph->info.xOff;
-		Y += glyph->info.yOff;
-	    }
-
-	    width = right - left;
-	    height = bottom - top;
-
-	    if(width && height) {
-		pitch = (((width + 31) & ~31) >> 5) + 1;
-		pntr = (CARD32*)xalloc(sizeof(CARD32) * pitch * height);
-		if(!pntr) 
-		    return TRUE;
-		bzero(pntr, sizeof(CARD32) * pitch * height);
-		n = list->len;
-
-		X = x; Y = y;
-		while(n--) {
-		    glyph = *glyphs++;
-		    h = glyph->info.height;
-		    w = glyph->info.width;
-		    if(h && w) {
-			row = y - top - glyph->info.y;
-			column = x - left - glyph->info.x;
-			pnt = pntr + (row * pitch) + (column >> 5);
-			column &= 31;
-			dwords = ((w + 31) >> 5) - 1;
-			bits = (CARD32*)(glyph + 1);
-			if(dwords) {
-			  while(h--) {
-			    for(i = 0; i <= dwords; i++) {
-				if(column) {
-				    pnt[i] |= SHIFT_L(*bits, column);
-				    pnt[i + 1] |= SHIFT_R(*bits, 32 - column);
-				} else
-				    pnt[i] |= *bits;
-
-				if(i != dwords) bits++;
-			    }
-			    bits++;
-			    pnt += pitch;
-			  } 
-			} else {
-			  if(column) {
-			     while(h--) {
-				pnt[0] |= SHIFT_L(*bits, column);
-				pnt[0 + 1] |= SHIFT_R(*bits, 32 - column);
-				bits++;
-				pnt += pitch;
-			     }
-			  } else {
-			     while(h--) {
-				*pnt |= *bits++;
-				pnt += pitch;
-			     }			  
-			  }	  
-			}
-		    }
-		    x += glyph->info.xOff;
-		    y += glyph->info.yOff;
-		}
-		
-		nbox = REGION_NUM_RECTS(pDst->pCompositeClip);
-		pbox = REGION_RECTS(pDst->pCompositeClip);
-		
-		while(nbox && (top >= pbox->y2)) {
-		    pbox++; nbox--;
-		}
-		
-		while(nbox && (bottom > pbox->y1)) {		
-		    leftEdge = max(left, pbox->x1);
-		    rightEdge = min(right, pbox->x2);
-		    
-		    if(rightEdge > leftEdge) {
-		    	column = leftEdge - left;
-			topLine = max(top, pbox->y1);
-			botLine = min(bottom, pbox->y2);
-			h = botLine - topLine;
-			
-			if(h > 0) {
-			  (*infoRec->WriteBitmap)(infoRec->pScrn, 
-			  	leftEdge, topLine, rightEdge - leftEdge, h,
-				(unsigned char*)(pntr + 
-				  ((topLine - top) * pitch) + (column >> 5)),
-				pitch << 2, column & 31, pixel, -1, GXcopy, ~0);
-			}
-		    }	
-		    nbox--; pbox++;
-	   	}
-		xfree(pntr);
-	    } else {
-		x = X; y = Y;
-	    }
-	    list++;
-	}
-
-	return TRUE;
-    }
-
     /*
      * If it looks like we have a chance of being able to draw these
      * glyphs with an accelerated Composite, do that now to avoid
commit f2aa0000a2220df4158ded8284d70954670aff36
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue May 6 17:52:37 2008 -0400

    Bug #13104: Don't let XAA glyph pixmaps anywhere near video memory.
    
    Since glyphs are stored in pixmaps now, they can make their way into VRAM,
    which invalidates a bunch of fast-path assumptions in the XAA code.  Thus
    you end up doing color-expands or WriteBitmap from la-la land and your
    aliased glyphs go all funny.
    
    Since XAA isn't ever growing the ability to do sane glyph accel, just force
    glyph pixmaps into host memory by catching them at CreatePixmap time.
    (cherry picked from commit 718652eaf9221e0eeec2c971dd7baa97f827451b)

diff --git a/hw/xfree86/xaa/xaaInit.c b/hw/xfree86/xaa/xaaInit.c
index 892cbcf..22a35a0 100644
--- a/hw/xfree86/xaa/xaaInit.c
+++ b/hw/xfree86/xaa/xaaInit.c
@@ -342,7 +342,9 @@ XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint)
     if (!infoRec->offscreenDepthsInitialized)
 	XAAInitializeOffscreenDepths (pScreen);
 
-    if(pScrn->vtSema && (infoRec->offscreenDepths & (1 << (depth - 1))) &&
+    if(pScrn->vtSema &&
+	(usage_hint != CREATE_PIXMAP_USAGE_GLYPH_PICTURE) &&
+	(infoRec->offscreenDepths & (1 << (depth - 1))) &&
 	(size >= MIN_OFFPIX_SIZE) && !SwitchedOut &&
 	(!infoRec->maxOffPixWidth || (w <= infoRec->maxOffPixWidth)) &&
 	(!infoRec->maxOffPixHeight || (h <= infoRec->maxOffPixHeight)) )
commit f7a9d30f825d5483cb89144a0dc2bfd0d1f47796
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Wed May 7 22:24:19 2008 +0300

    XKB: Actually explain keymap failures
    
    When something went wrong building a keymap, try to explain to the user
    what it actually was, instead of the dreaded 'Failed to load XKB keymap'
    catch-all.
    (cherry picked from commit cf20df39cc78203d17b99223908af388ecbf7d0e)

diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c
index d80ce62..1fb0979 100644
--- a/xkb/ddxLoad.c
+++ b/xkb/ddxLoad.c
@@ -274,7 +274,7 @@ char tmpname[PATH_MAX];
 	    return True;
 	}
 	else
-	    DebugF("Error compiling keymap (%s)\n",keymap);
+	    LogMessage(X_ERROR, "Error compiling keymap (%s)\n", keymap);
 #ifdef WIN32
         /* remove the temporary file */
         unlink(tmpname);
@@ -282,9 +282,9 @@ char tmpname[PATH_MAX];
     }
     else {
 #ifndef WIN32
-	DebugF("Could not invoke keymap compiler\n");
+	LogMessage(X_ERROR, "XKB: Could not invoke xkbcomp\n");
 #else
-	DebugF("Could not open file %s\n", tmpname);
+	LogMessage(X_ERROR, "Could not open file %s\n", tmpname);
 #endif
     }
     if (nameRtrn)
@@ -350,11 +350,13 @@ unsigned	missing;
     if ((names->keycodes==NULL)&&(names->types==NULL)&&
 	(names->compat==NULL)&&(names->symbols==NULL)&&
 	(names->geometry==NULL)) {
+        LogMessage(X_ERROR, "XKB: No components provided for device %s\n",
+                   keybd->name);
         return 0;
     }
     else if (!XkbDDXCompileKeymapByNames(xkb,names,want,need,
                                          nameRtrn,nameRtrnLen)){
-	DebugF("Couldn't compile keymap file\n");
+	LogMessage(X_ERROR, "XKB: Couldn't compile keymap\n");
 	return 0;
     }
     file= XkbDDXOpenConfigFile(nameRtrn,fileName,PATH_MAX);
@@ -369,7 +371,7 @@ unsigned	missing;
 	(void) unlink (fileName);
 	return 0;
     }
-    else if (xkbDebugFlags) {
+    else {
 	DebugF("Loaded XKB keymap %s, defined=0x%x\n",fileName,(*xkbRtrn)->defined);
     }
     fclose(file);
@@ -390,32 +392,40 @@ XkbRF_RulesPtr	rules;
 
     if (!rules_name)
 	return False;
-    if (XkbBaseDirectory==NULL) {
-	if (strlen(rules_name)+7 > PATH_MAX)
-	    return False;
-	sprintf(buf,"rules/%s",rules_name);
-    }
-    else {
-	if (strlen(XkbBaseDirectory)+strlen(rules_name)+8 > PATH_MAX)
-	    return False;
-        sprintf(buf,"%s/rules/%s",XkbBaseDirectory,rules_name);
+
+    if (strlen(XkbBaseDirectory) + strlen(rules_name) + 8 > PATH_MAX) {
+        LogMessage(X_ERROR, "XKB: Rules name is too long\n");
+        return False;
     }
-    if ((file= fopen(buf,"r"))==NULL)
+    sprintf(buf,"%s/rules/%s", XkbBaseDirectory, rules_name);
+
+    file = fopen(buf, "r");
+    if (!file) {
+        LogMessage(X_ERROR, "XKB: Couldn't open rules file %s\n", file);
 	return False;
-    if ((rules= XkbRF_Create(0,0))==NULL) {
+    }
+
+    rules = XkbRF_Create(0, 0);
+    if (!rules) {
+        LogMessage(X_ERROR, "XKB: Couldn't create rules struct\n");
 	fclose(file);
 	return False;
     }
-    if (!XkbRF_LoadRules(file,rules)) {
+
+    if (!XkbRF_LoadRules(file, rules)) {
+        LogMessage(X_ERROR, "XKB: Couldn't parse rules file %s\n", rules_name);
 	fclose(file);
 	XkbRF_Free(rules,True);
 	return False;
     }
-    bzero((char *)names,sizeof(XkbComponentNamesRec));
-    complete= XkbRF_GetComponents(rules,defs,names);
+
+    memset(names, 0, sizeof(*names));
+    complete = XkbRF_GetComponents(rules,defs,names);
     fclose(file);
-    XkbRF_Free(rules,True);
-    return complete;
-}
+    XkbRF_Free(rules, True);
 
+    if (!complete)
+        LogMessage(X_ERROR, "XKB: Rules returned no components\n");
 
+    return complete;
+}
commit 3e7152704895223fae9407a3e109af82b2908c9b
Author: Keith Packard <keithp at keithp.com>
Date:   Sun May 4 21:51:08 2008 -0700

    Empty the borderClip of manual redirect windows. (bug 15823)
    
    Thanks to Owen Taylor for root-causing this one.
    
    If a TreatAsTransparent window has any area in the borderClip, that will be
    added to the totalClip region for use by other windows. That's wrong.
    Instead, simply empty the borderClip for TreatAsTransparent windows right up
    front.
    (cherry picked from commit 6c1accce87c9bd640c1b4bbc49bae7d44b1cc97b)

diff --git a/mi/mivaltree.c b/mi/mivaltree.c
index 74483e3..d9d07ca 100644
--- a/mi/mivaltree.c
+++ b/mi/mivaltree.c
@@ -255,7 +255,11 @@ miComputeClips (
     if (pParent->redirectDraw != RedirectDrawNone)
     {
 	if (miSetRedirectBorderClipProc)
+	{
+	    if (TreatAsTransparent (pParent))
+		REGION_EMPTY (pScreen, universe);
 	    (*miSetRedirectBorderClipProc) (pParent, universe);
+	}
 	REGION_COPY(pScreen, universe, &pParent->borderSize);
     }
 #endif
commit fd0ec73bcb780dbc04478b17ad6c02aa55ca2558
Author: Jordan Crouse <jordan.crouse at amd.com>
Date:   Mon Apr 21 12:09:00 2008 -0600

    xf86: Change AutoConfig driver for PCI ID 022:2091 to 'geode'
    (cherry picked from commit 4fa89fbe18c929e0d36305ab47e7e17841309ffd)

diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c
index 92b204b..5ffd847 100644
--- a/hw/xfree86/common/xf86AutoConfig.c
+++ b/hw/xfree86/common/xf86AutoConfig.c
@@ -146,7 +146,11 @@ videoPtrToDriverName(struct pci_device *dev)
 
     switch (dev->vendor_id)
     {
-	case 0x1022:		    return "amd";
+	case 0x1022:
+		if (dev->device_id == 0x2081)
+			return "geode";
+		else
+			return NULL;
 	case 0x1142:		    return "apm";
 	case 0xedd8:		    return "ark";
 	case 0x1a03:		    return "ast";


More information about the xorg-commit mailing list