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

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Sat Dec 8 00:37:12 PST 2007


 configure.ac                         |  106 ++++++++++++++++-------------------
 hw/xquartz/Makefile.am               |    2 
 hw/xquartz/bundle/Info.plist         |   34 ++++++-----
 hw/xquartz/bundle/Makefile.am        |    2 
 hw/xquartz/bundle/bundle-main.c      |   34 +++--------
 hw/xquartz/bundle/org.x.X11.plist    |   25 --------
 hw/xquartz/bundle/org.x.X11.plist.in |   25 ++++++++
 hw/xquartz/darwin.c                  |    5 +
 hw/xquartz/quartzStartup.c           |    3 
 9 files changed, 119 insertions(+), 117 deletions(-)

New commits:
commit 743b266c17c68146bd5e4148a667220ae03ce603
Author: Jeremy Huddleston <jeremy at yuffie.local>
Date:   Sat Dec 8 00:13:47 2007 -0800

    XQuartz: Fixed "Multiple Dock Icons"
    BAM!
    (cherry picked from commit d0dca8a88506f50b51f41f99a2f1feb6954c8a31)
    (cherry picked from commit 0502955a2af487b51bf22916ac02e497c2d96aba)

diff --git a/hw/xquartz/Makefile.am b/hw/xquartz/Makefile.am
index fff7c4b..b6a1de9 100644
--- a/hw/xquartz/Makefile.am
+++ b/hw/xquartz/Makefile.am
@@ -29,6 +29,7 @@ libXquartz_la_SOURCES = \
 	quartz.c \
 	quartzAudio.c \
 	quartzCocoa.m \
+	quartzForeground.c \
 	quartzKeyboard.c \
 	quartzPasteboard.c \
 	quartzStartup.c
@@ -46,5 +47,6 @@ EXTRA_DIST = \
 	quartzCommon.h \
 	quartzCursor.c \
 	quartzCursor.h \
+	quartzForeground.h \
 	quartz.h \
 	quartzPasteboard.h
diff --git a/hw/xquartz/bundle/Info.plist b/hw/xquartz/bundle/Info.plist
index 66f1f6b..fce8c96 100644
--- a/hw/xquartz/bundle/Info.plist
+++ b/hw/xquartz/bundle/Info.plist
@@ -3,33 +3,37 @@
 <plist version="1.0">
 <dict>
 	<key>CFBundleDevelopmentRegion</key>
-	<string>English</string>
+		<string>English</string>
 	<key>CFBundleExecutable</key>
-	<string>X11</string>
+		<string>X11</string>
 	<key>CFBundleGetInfoString</key>
-	<string>X11</string>
+		<string>X11</string>
 	<key>CFBundleIconFile</key>
-	<string>X11.icns</string>
+		<string>X11.icns</string>
 	<key>CFBundleIdentifier</key>
-	<string>org.x.X11</string>
+		<string>org.x.X11</string>
 	<key>CFBundleInfoDictionaryVersion</key>
-	<string>6.0</string>
+		<string>6.0</string>
 	<key>CFBundleName</key>
-	<string>X11</string>
+		<string>X11</string>
 	<key>CFBundlePackageType</key>
-	<string>APPL</string>
+		<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>2.0</string>
+		<string>2.2.0</string>
 	<key>CFBundleSignature</key>
-	<string>x11a</string>
+		<string>x11a</string>
 	<key>CSResourcesFileMapped</key>
-	<true/>
+		<true/>
 	<key>NSHumanReadableCopyright</key>
-	<string>Copyright © 2003-2007, Apple Inc.
-Copyright © 2003, XFree86 Project, Inc.</string>
+		<string>Copyright © 2003-2007, Apple Inc.
+Copyright © 2003, XFree86 Project, Inc.
+Copyright © 2003-2007, X.org Project, Inc.
+</string>
 	<key>NSMainNibFile</key>
-	<string>main</string>
+		<string>main</string>
 	<key>NSPrincipalClass</key>
-	<string>X11Application</string>
+		<string>X11Application</string>
+	<key>LSBackgroundOnly</key>
+		<true/>
 </dict>
 </plist>
diff --git a/hw/xquartz/bundle/bundle-main.c b/hw/xquartz/bundle/bundle-main.c
index 6f9744c..53f60a3 100644
--- a/hw/xquartz/bundle/bundle-main.c
+++ b/hw/xquartz/bundle/bundle-main.c
@@ -38,22 +38,13 @@ int server_main(int argc, char **argv);
 
 int main(int argc, char **argv) {
     Display *display;
-  
-    fprintf(stderr, "X11.app: main(): argc=%d\n", argc);
-    int i;
-    for(i=0; i < argc; i++) {
-        fprintf(stderr, "\targv[%d] = %s\n", i, argv[i]);
-    }
-    
-    /* First check if launchd started us */
-    if(argc == 2 && !strncmp(argv[1], "-launchd", 8)) {
-        argc--;
-        argv[1] = argv[0];
-        argv++;
-        fprintf(stderr, "X11.app: main(): launchd called us, running server_main()");
-        return server_main(argc, argv);
-    }
 
+    //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]);
+    //}
+    
     /* 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
      */
@@ -64,19 +55,18 @@ int main(int argc, char **argv) {
             fprintf(stderr, "X11.app: main(): closing the display");
             /* 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);
-            fprintf(stderr, "X11.app: main(): running launcher_main()");
+            //fprintf(stderr, "X11.app: main(): running launcher_main()");
             return launcher_main(argc, argv);
         }
     }
-
-    /* Couldn't open the display or we were called with arguments,
-     * just want to start a server.
-     */
-    fprintf(stderr, "X11.app: main(): running server_main()");
+    
+    /* Start the server */
+    //fprintf(stderr, "X11.app: main(): running server_main()");
     return server_main(argc, argv);
 }
+
diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index a106cca..aaed261 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -707,6 +707,11 @@ void ddxInitGlobals(void)
  */
 int ddxProcessArgument( int argc, char *argv[], int i )
 {
+    if( !strcmp( argv[i], "-launchd" ) ) {
+        ErrorF( "Launchd command line argument noticed.\n" );
+        return 1;
+    }
+
     if ( !strcmp( argv[i], "-fullscreen" ) ) {
         ErrorF( "Running full screen in parallel with Mac OS X Quartz window server.\n" );
         return 1;
diff --git a/hw/xquartz/quartzStartup.c b/hw/xquartz/quartzStartup.c
index e20c16b..87bcada 100644
--- a/hw/xquartz/quartzStartup.c
+++ b/hw/xquartz/quartzStartup.c
@@ -34,6 +34,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <CoreFoundation/CoreFoundation.h>
+#include "quartzForeground.h"
 #include "quartzCommon.h"
 #include "darwin.h"
 #include "quartz.h"
@@ -76,6 +77,8 @@ void DarwinHandleGUI(
     int         i;
     int         fd[2];
 
+    QuartzMoveToForeground();
+    
     if (been_here) {
         return;
     }
commit 5676ba6fc07022adcc6368218237fcb812b8d25d
Author: Jeremy Huddleston <jeremy at yuffie.local>
Date:   Fri Dec 7 23:21:08 2007 -0800

    XQuartz: Cleaned up configure, X11.app path in launchd script
    Don't hardcode X11.app's path in the launchd plist.
    Only install the launchd plist if we --enable-launchd.
    (cherry picked from commit 6b74c535dc331d1d621b2541492a3336f69d70a2)

diff --git a/configure.ac b/configure.ac
index 7297dc7..0fab244 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1730,47 +1730,56 @@ fi
 if test "x$XQUARTZ" = xyes; then
 	AC_DEFINE([XQUARTZ],[1],[Have Quartz])
 
-#	       glxAGL / glxCGL don't work yet
-#               AC_CACHE_CHECK([for AGL framework],xorg_cv_AGL_framework,[
-#               save_LDFLAGS=$LDFLAGS
-#               LDFLAGS="$LDFLAGS -framework AGL"
-#               AC_LINK_IFELSE([char aglEnable();
-#int main() {
-#aglEnable();
-#return 0;}
-#               ],[xorg_cv_AGL_framework=yes],
-#               [xorg_cv_AGL_framework=no])
-#               LDFLAGS=$save_LDFLAGS
-#               ])
-               xorg_cv_AGL_framework=no
-	       DARWIN_GLX_LIBS='$(top_builddir)/GL/apple/indirect.o $(top_builddir)/GL/glx/libglx.la'
-	       DARWIN_LIBS="$MI_LIB $OS_LIB $DIX_LIB $FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_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],[:])
-               AC_SUBST([APPLE_APPLICATIONS_DIR])
-               CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DNO_ALLOCA"
-               PLIST_VERSION_STRING=$PACKAGE_VERSION
-               AC_SUBST([PLIST_VERSION_STRING])
-               PLIST_VENDOR_WEB=$VENDOR_WEB
-               AC_SUBST([PLIST_VENDOR_WEB])
-               if test "x$XF86MISC" = xyes || test "x$XF86MISC" = xauto; then
-                       AC_MSG_NOTICE([Disabling XF86Misc extension])
-                       XF86MISC=no
-               fi
-               if test "x$XF86VIDMODE" = xyes || test "x$XF86VIDMODE" = xauto; then
-                       AC_MSG_NOTICE([Disabling XF86VidMode extension])
-                       XF86VIDMODE=no
-               fi
-               if test "x$XF86BIGFONT" = xyes || test "x$XF86BIGFONT" = xauto; then
-                       AC_MSG_NOTICE([Disabling XF86BigFont extension])
-                       XF86BIGFONT=no
-               fi
-               if test "x$DGA" = xyes || test "x$DGA" = xauto; then
-                       AC_MSG_NOTICE([Disabling DGA extension])
-                       DGA=no
-               fi
+#glxAGL / glxCGL don't work yet
+#	AC_CACHE_CHECK([for AGL framework],xorg_cv_AGL_framework,[
+#		save_LDFLAGS=$LDFLAGS
+#		LDFLAGS="$LDFLAGS -framework AGL"
+#		AC_LINK_IFELSE(
+#			[char aglEnable(); int main() { aglEnable(); return 0;}],
+#			[xorg_cv_AGL_framework=yes],
+#			[xorg_cv_AGL_framework=no])
+#		LDFLAGS=$save_LDFLAGS
+#	])
+	xorg_cv_AGL_framework=no
+	DARWIN_GLX_LIBS='$(top_builddir)/GL/apple/indirect.o $(top_builddir)/GL/glx/libglx.la'
+	DARWIN_LIBS="$MI_LIB $OS_LIB $DIX_LIB $FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_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],[:])
+	AC_SUBST([APPLE_APPLICATIONS_DIR])
+	CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DNO_ALLOCA"
+	if test "x$XF86MISC" = xyes || test "x$XF86MISC" = xauto; then
+		AC_MSG_NOTICE([Disabling XF86Misc extension])
+		XF86MISC=no
+	fi
+	if test "x$XF86VIDMODE" = xyes || test "x$XF86VIDMODE" = xauto; then
+		AC_MSG_NOTICE([Disabling XF86VidMode extension])
+		XF86VIDMODE=no
+	fi
+	if test "x$XF86BIGFONT" = xyes || test "x$XF86BIGFONT" = xauto; then
+		AC_MSG_NOTICE([Disabling XF86BigFont extension])
+		XF86BIGFONT=no
+	fi
+	if test "x$DGA" = xyes || test "x$DGA" = xauto; then
+		AC_MSG_NOTICE([Disabling DGA extension])
+		DGA=no
+	fi
 fi
 
+# Support for objc in autotools is minimal and not documented.
+OBJC='$(CC)'
+OBJCLD='$(CCLD)'
+OBJCLINK='$(LINK)'
+OBJCFLAGS='$(CFLAGS)'
+AC_SUBST([OBJC])
+AC_SUBST([OBJCCLD])
+AC_SUBST([OBJCLINK])
+AC_SUBST([OBJCFLAGS])
+# internal, undocumented automake func follows :(
+_AM_DEPENDENCIES([OBJC])
+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$X11APP" = xauto; then
 	AC_MSG_CHECKING([whether to build X11.app])
 	if test "x$XQUARTZ" = xyes ; then
@@ -1780,6 +1789,7 @@ if test "x$X11APP" = xauto; then
 	fi
 	AC_MSG_RESULT([$X11APP])
 fi
+AM_CONDITIONAL(X11APP,[test "X$X11APP" = Xyes]) 
 
 if test "x$LAUNCHD" = xauto; then
 	# Do we want to have this default to on for Xquartz builds only or any time we have launchd (like Xnest or Xvfb on OS-X)
@@ -1796,22 +1806,7 @@ fi
 if test "x$LAUNCHD" = xyes ; then
 	AC_DEFINE(HAVE_LAUNCHD, 1, [launchd support available])
 fi
-
-# Support for objc in autotools is minimal and not documented.
-OBJC='$(CC)'
-OBJCLD='$(CCLD)'
-OBJCLINK='$(LINK)'
-OBJCFLAGS='$(CFLAGS)'
-AC_SUBST([OBJC])
-AC_SUBST([OBJCCLD])
-AC_SUBST([OBJCLINK])
-AC_SUBST([OBJCFLAGS])
-# internal, undocumented automake func follows :(
-_AM_DEPENDENCIES([OBJC])
-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])
-AM_CONDITIONAL(X11APP,[test "X$X11APP" = Xyes]) 
+AM_CONDITIONAL(LAUNCHD, [test "x$LAUNCHD" = xyes])
 
 dnl kdrive DDX
 
@@ -2155,6 +2150,7 @@ hw/xnest/Makefile
 hw/xwin/Makefile
 hw/xquartz/Makefile
 hw/xquartz/bundle/Makefile
+hw/xquartz/bundle/org.x.X11.plist
 hw/xquartz/xpr/Makefile
 hw/kdrive/Makefile
 hw/kdrive/ati/Makefile
diff --git a/hw/xquartz/bundle/Makefile.am b/hw/xquartz/bundle/Makefile.am
index a6e2dfb..e8d5167 100644
--- a/hw/xquartz/bundle/Makefile.am
+++ b/hw/xquartz/bundle/Makefile.am
@@ -7,8 +7,10 @@ x11app:
 
 install-data-hook:
 	xcodebuild install DSTROOT="/$(DESTDIR)" INSTALL_PATH="$(APPLE_APPLICATIONS_DIR)" DEPLOYMENT_LOCATION=YES SKIP_INSTALL=NO ARCHS="$(X11APP_ARCHS)"
+if LAUNCHD
 	$(MKDIR_P) "$(DESTDIR)/System/Library/LaunchAgents/"
 	$(INSTALL) org.x.X11.plist "$(DESTDIR)/System/Library/LaunchAgents/"
+endif
 
 clean-local:
 	rm -rf build
diff --git a/hw/xquartz/bundle/bundle-main.c b/hw/xquartz/bundle/bundle-main.c
index c436d51..6f9744c 100644
--- a/hw/xquartz/bundle/bundle-main.c
+++ b/hw/xquartz/bundle/bundle-main.c
@@ -46,7 +46,7 @@ int main(int argc, char **argv) {
     }
     
     /* First check if launchd started us */
-    if(argc == 2 && !strncmp(argv[1], "--launchd", 9)) {
+    if(argc == 2 && !strncmp(argv[1], "-launchd", 8)) {
         argc--;
         argv[1] = argv[0];
         argv++;
diff --git a/hw/xquartz/bundle/org.x.X11.plist b/hw/xquartz/bundle/org.x.X11.plist
deleted file mode 100644
index 6c6be91..0000000
--- a/hw/xquartz/bundle/org.x.X11.plist
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>Label</key>
-		<string>org.x.X11</string>
-	<key>Program</key>
-		<string>/Applications/Utilities/X11.app/Contents/MacOS/X11</string>
-	<key>ProgramArguments</key>
-		<array>
-		<string>/Applications/Utilities/X11.app/Contents/MacOS/X11</string>
-		<string>--launchd</string>
-		</array>
-	<key>Sockets</key>
-		<dict>
-		<key>:0</key>
-			<dict>
-			<key>SecureSocketWithKey</key>
-				<string>DISPLAY</string>
-			</dict>
-		</dict>
-	<key>ServiceIPC</key>
-		<true/>
-</dict>
-</plist>
diff --git a/hw/xquartz/bundle/org.x.X11.plist.in b/hw/xquartz/bundle/org.x.X11.plist.in
new file mode 100644
index 0000000..36849cf
--- /dev/null
+++ b/hw/xquartz/bundle/org.x.X11.plist.in
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>Label</key>
+		<string>org.x.X11</string>
+	<key>Program</key>
+		<string>@APPLE_APPLICATIONS_DIR@/X11.app/Contents/MacOS/X11</string>
+	<key>ProgramArguments</key>
+		<array>
+		<string>@APPLE_APPLICATIONS_DIR@/X11.app/Contents/MacOS/X11</string>
+		<string>-launchd</string>
+		</array>
+	<key>Sockets</key>
+		<dict>
+		<key>:0</key>
+			<dict>
+			<key>SecureSocketWithKey</key>
+				<string>DISPLAY</string>
+			</dict>
+		</dict>
+	<key>ServiceIPC</key>
+		<true/>
+</dict>
+</plist>


More information about the xorg-commit mailing list