xserver: Branch 'master' - 3 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Fri Dec 14 15:25:49 PST 2007


 hw/xquartz/Makefile.am          |    2 +-
 hw/xquartz/bundle/bundle-main.c |    2 +-
 hw/xquartz/x11-exec.c           |   24 +++++++++++++++++-------
 3 files changed, 19 insertions(+), 9 deletions(-)

New commits:
commit a3f7f7b60e391e6106f5db40b3fe5fbc67ccd836
Author: Ben Byer <bbyer at bbyer.apple.com>
Date:   Thu Dec 13 20:45:14 2007 -0800

    clarified debug message to indicate that we're sleeping
    (in case we get reports about slow launch times, this will
    help clarify what's happening)
    (cherry picked from commit 2eea3483cf893f8f81bacd434b31408dfb38cb06)

diff --git a/hw/xquartz/bundle/bundle-main.c b/hw/xquartz/bundle/bundle-main.c
index 53f60a3..681e1a8 100644
--- a/hw/xquartz/bundle/bundle-main.c
+++ b/hw/xquartz/bundle/bundle-main.c
@@ -52,7 +52,7 @@ int main(int argc, char **argv) {
         /* Now, try to open a display, if so, run the launcher */
         display = XOpenDisplay(NULL);
         if(display) {
-            fprintf(stderr, "X11.app: main(): closing the display");
+            fprintf(stderr, "X11.app: main(): closing the display and sleeping");
             /* Could open the display, start the launcher */
             XCloseDisplay(display);
             
commit e0e59b3bbc4d8e7ac3934a6f6a9e4a15b328c475
Author: Ben Byer <bbyer at bbyer.apple.com>
Date:   Thu Dec 13 20:44:33 2007 -0800

    we need to link against CoreServices, not ApplicationServices
    (cherry picked from commit ba4d2096e7953ef5b971682f0e28535da968acb1)

diff --git a/hw/xquartz/Makefile.am b/hw/xquartz/Makefile.am
index 97b8c94..0326f78 100644
--- a/hw/xquartz/Makefile.am
+++ b/hw/xquartz/Makefile.am
@@ -12,7 +12,7 @@ X11APP_SUBDIRS = bundle
 
 if LAUNCHD
 libexec_PROGRAMS = x11-exec
-x11_exec_LDFLAGS = -framework ApplicationServices
+x11_exec_LDFLAGS = -framework CoreServices
 endif
 
 endif
commit 062d9234e233fc4c1c617f59093da973c9d3e2ce
Author: Ben Byer <bbyer at bbyer.apple.com>
Date:   Thu Dec 13 20:40:27 2007 -0800

    fixed bug in x11-exec that prevent icon from showing up
    (cherry picked from commit e1f4a0c20d3a52d98954c4b28d0ec4d44564bc32)

diff --git a/hw/xquartz/x11-exec.c b/hw/xquartz/x11-exec.c
index d0b5c49..105fd72 100644
--- a/hw/xquartz/x11-exec.c
+++ b/hw/xquartz/x11-exec.c
@@ -28,7 +28,7 @@
  promote the sale, use or other dealings in this Software without
  prior written authorization. */
 
-#include <ApplicationServices/ApplicationServices.h>
+#include <CoreServices/CoreServices.h>
 #include <stdio.h>
 
 #define kX11AppBundleId "org.x.X11"
@@ -36,10 +36,10 @@
 
 int main(int argc, char **argv) {
   char x11_path[PATH_MAX];
+  char** args = NULL;
   CFURLRef appURL = NULL;
-  OSStatus osstatus = 
-    LSFindApplicationForInfo(kLSUnknownCreator, CFSTR(kX11AppBundleId), 
-			     nil, nil, &appURL);
+  OSStatus osstatus = LSFindApplicationForInfo(kLSUnknownCreator, CFSTR(kX11AppBundleId), 
+					       nil, nil, &appURL);
   
   switch (osstatus) {
   case noErr:
@@ -52,10 +52,20 @@ int main(int argc, char **argv) {
       fprintf(stderr, "%s: Error resolving URL for %s\n", argv[0], kX11AppBundleId);
       exit(2);
     }
-    strlcpy(argv[0], "X11", strlen(argv[0])+1);
+    
+    args = (char**)malloc(sizeof (char*) * (argc + 1));
     strlcat(x11_path, kX11AppBundlePath, sizeof(x11_path));
-//  fprintf(stderr, "X11.app = %s\n", x11_path);
-    execv(x11_path, argv);
+    if (args) {
+      int i;
+      args[0] = x11_path;
+      for (i = 1; i < argc; ++i) {
+        args[i] = argv[i];
+      }
+      args[i] = NULL;
+    }
+    
+    fprintf(stderr, "X11.app = %s\n", x11_path);
+    execv(x11_path, args);
     fprintf(stderr, "Error executing X11.app (%s):", x11_path);
     perror(NULL);
     exit(3);


More information about the xorg-commit mailing list