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

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Tue Jun 10 10:52:16 PDT 2008


 hw/xquartz/Makefile.am                |    5 ---
 hw/xquartz/bundle/Info.plist          |    2 -
 hw/xquartz/mach-startup/Makefile.am   |    3 --
 hw/xquartz/mach-startup/bundle-main.c |   28 --------------------
 hw/xquartz/mach-startup/stub.c        |   11 -------
 hw/xquartz/quartzForeground.c         |   47 ----------------------------------
 hw/xquartz/quartzForeground.h         |   37 --------------------------
 hw/xquartz/quartzStartup.c            |    1 
 8 files changed, 2 insertions(+), 132 deletions(-)

New commits:
commit 0ab483f74e778d8c4e76c3640d62d160fe4d5267
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Tue Jun 10 10:47:37 2008 -0700

    XQuartz: Removed code path for old startup
    (cherry picked from commit a9ee6b0d00fab01a78408a85e6542e88c19fda7c)

diff --git a/hw/xquartz/Makefile.am b/hw/xquartz/Makefile.am
index eb2ebb0..be9ad1c 100644
--- a/hw/xquartz/Makefile.am
+++ b/hw/xquartz/Makefile.am
@@ -7,8 +7,7 @@ AM_CPPFLAGS = \
 	-DINXQUARTZ \
 	-DUSE_NEW_CLUT \
 	-DXFree86Server \
-	-I$(top_srcdir)/miext/rootless \
-	-DNEW_LAUNCH_METHOD
+	-I$(top_srcdir)/miext/rootless
 
 SUBDIRS = bundle . GL xpr mach-startup doc
 
diff --git a/hw/xquartz/mach-startup/Makefile.am b/hw/xquartz/mach-startup/Makefile.am
index 59018a9..2da3062 100644
--- a/hw/xquartz/mach-startup/Makefile.am
+++ b/hw/xquartz/mach-startup/Makefile.am
@@ -1,7 +1,6 @@
 AM_CPPFLAGS = \
 	-DBUILD_DATE=\"$(BUILD_DATE)\" \
-	-DXSERVER_VERSION=\"$(VERSION)\" \
-	-DNEW_LAUNCH_METHOD -DNEW_LAUNCH_METHOD_2
+	-DXSERVER_VERSION=\"$(VERSION)\"
 
 x11appdir = $(APPLE_APPLICATIONS_DIR)/X11.app/Contents/MacOS
 x11app_PROGRAMS = X11
diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c
index d7b6c37..d2bc9d3 100644
--- a/hw/xquartz/mach-startup/bundle-main.c
+++ b/hw/xquartz/mach-startup/bundle-main.c
@@ -78,7 +78,6 @@ static pthread_t create_thread(void *func, void *arg) {
     return tid;
 }
 
-#ifdef NEW_LAUNCH_METHOD
 /*** Mach-O IPC Stuffs ***/
 
 union MaxMsgSize {
@@ -278,25 +277,13 @@ 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;
     const char *s;
     
     size_t i;
-#ifndef NEW_LAUNCH_METHOD
-    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]);
-    }
-#endif
     
     /* Take care of the case where we're called like a normal DDX */
     if(argc > 1 && argv[1][0] == ':') {
-#ifdef NEW_LAUNCH_METHOD
         kern_return_t kr;
         mach_port_t mp;
         string_array_t newenvp;
@@ -336,10 +323,6 @@ int main(int argc, char **argv, char **envp) {
             exit(EXIT_FAILURE);
         }
         exit(EXIT_SUCCESS);
-#else
-        create_thread(add_launchd_display_thread, NULL);
-        return server_main(argc, argv, envp);
-#endif
     }
 
     /* If we have a process serial number and it's our only arg, act as if
@@ -369,7 +352,6 @@ int main(int argc, char **argv, char **envp) {
     return execute(command_from_prefs("startx_script", DEFAULT_STARTX));
 }
 
-#ifdef NEW_LAUNCH_METHOD
 /*** Main ***/
 int main(int argc, char **argv, char **envp) {
     Bool listenOnly = FALSE;
@@ -411,16 +393,6 @@ int main(int argc, char **argv, char **envp) {
     
     return EXIT_SUCCESS;
 }
-#else
-void *add_launchd_display_thread(void *data) {
-    /* 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) {
     const char *newargv[7];
diff --git a/hw/xquartz/mach-startup/stub.c b/hw/xquartz/mach-startup/stub.c
index 7d98752..d7b248b 100644
--- a/hw/xquartz/mach-startup/stub.c
+++ b/hw/xquartz/mach-startup/stub.c
@@ -113,7 +113,6 @@ static void set_x11_path() {
     }
 }
 
-#ifdef NEW_LAUNCH_METHOD
 static int create_socket(char *filename_out) {
     struct sockaddr_un servaddr_un;
     struct sockaddr *servaddr;
@@ -201,10 +200,8 @@ static void send_fd_handoff(int handoff_fd, int launchd_fd) {
     close(connected_fd);
     fprintf(stderr, "send %d %d %d %s\n", handoff_fd, launchd_fd, errno, strerror(errno));
 }
-#endif
 
 int main(int argc, char **argv, char **envp) {
-#ifdef NEW_LAUNCH_METHOD
     int envpc;
     kern_return_t kr;
     mach_port_t mp;
@@ -213,7 +210,6 @@ int main(int argc, char **argv, char **envp) {
     size_t i;
     int launchd_fd;
     string_t handoff_socket_filename;
-#endif
     sig_t handler;
 
     if(argc == 2 && !strcmp(argv[1], "-version")) {
@@ -232,7 +228,6 @@ int main(int argc, char **argv, char **envp) {
         kill(getppid(), SIGUSR1);
     signal(SIGUSR1, handler);
     
-#ifdef NEW_LAUNCH_METHOD
     /* Get the $DISPLAY FD */
     launchd_fd = launchd_display_fd();
 
@@ -313,10 +308,4 @@ int main(int argc, char **argv, char **envp) {
         return EXIT_FAILURE;
     }
     return EXIT_SUCCESS;
-    
-#else
-    set_x11_path();
-    argv[0] = x11_path;
-    return execvp(x11_path, argv);
-#endif
 }
commit be616f0f8f6468e330d0effac4915ca3e78769be
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Tue Jun 10 02:15:25 2008 -0700

    XQuartz: Under the new startup model, we no longer need to do the foreground/background dance.
    (cherry picked from commit 4505bae5d7341e1241be50c25cb3d1b941701de4)

diff --git a/hw/xquartz/Makefile.am b/hw/xquartz/Makefile.am
index 69778c1..eb2ebb0 100644
--- a/hw/xquartz/Makefile.am
+++ b/hw/xquartz/Makefile.am
@@ -26,7 +26,6 @@ libXquartz_la_SOURCES = \
 	quartz.c \
 	quartzAudio.c \
 	quartzCocoa.m \
-	quartzForeground.c \
 	quartzKeyboard.c \
 	quartzPasteboard.c \
 	quartzStartup.c \
@@ -44,7 +43,6 @@ EXTRA_DIST = \
 	quartz.h \
 	quartzAudio.h \
 	quartzCommon.h \
-	quartzForeground.h \
 	quartzKeyboard.h \
 	quartzPasteboard.h \
 	sanitizedCarbon.h \
diff --git a/hw/xquartz/bundle/Info.plist b/hw/xquartz/bundle/Info.plist
index 30bb3c8..f06a30d 100644
--- a/hw/xquartz/bundle/Info.plist
+++ b/hw/xquartz/bundle/Info.plist
@@ -37,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/quartzForeground.c b/hw/xquartz/quartzForeground.c
deleted file mode 100644
index 80a04a1..0000000
--- a/hw/xquartz/quartzForeground.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* foreground.c - Push the current process into the foreground.
-
- This is in a separate file because of Quartz/X type conflicts.
-
- Copyright (c) 2007 Jeremy Huddleston
- 
- 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 <ApplicationServices/ApplicationServices.h>
-#include <stdio.h>
-
-#include "quartzForeground.h"
-
-int QuartzMoveToForeground() {
-   ProcessSerialNumber psn = { 0, kCurrentProcess };
-   OSStatus returnCode = TransformProcessType(& psn, kProcessTransformToForegroundApplication);
-   if( returnCode == 0) {
-       /* fprintf(stderr, "TransformProcessType: Success\n"); */
-       SetFrontProcess(&psn);
-   } else {
-       fprintf(stderr, "TransformProcessType: Failure\n");
-   }
-   return (int)returnCode;
-}
diff --git a/hw/xquartz/quartzForeground.h b/hw/xquartz/quartzForeground.h
deleted file mode 100644
index b5422ff..0000000
--- a/hw/xquartz/quartzForeground.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* foreground.h - Push the current process into the foreground.
- 
- This is in a separate file because of Quartz/X type conflicts.
- 
- Copyright (c) 2007 Jeremy Huddleston
- 
- 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 _QUARTZ_FOREGROUND_H_
-#define _QUARTZ_FOREGROUND_H_
-
-int QuartzMoveToForeground(void);
-
-#endif /* _QUARTZ_FOREGROUND_H_ */
diff --git a/hw/xquartz/quartzStartup.c b/hw/xquartz/quartzStartup.c
index 5cc437f..8a0501a 100644
--- a/hw/xquartz/quartzStartup.c
+++ b/hw/xquartz/quartzStartup.c
@@ -127,7 +127,6 @@ int server_main(int argc, char **argv, char **envp) {
     /* Create the audio mutex */
     QuartzAudioInit();
 
-    QuartzMoveToForeground();
     X11ControllerMain(argc, argv, envp);
     exit(0);
 }


More information about the xorg-commit mailing list