diff --git a/hw/xquartz/Makefile.am b/hw/xquartz/Makefile.am
index 725d20f6c..5814eb79f 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 66f1f6be1..fce8c964d 100644
--- a/hw/xquartz/bundle/Info.plist
+++ b/hw/xquartz/bundle/Info.plist
@@ -3,33 +3,37 @@
CFBundleDevelopmentRegion
- English
+ English
CFBundleExecutable
- X11
+ X11
CFBundleGetInfoString
- X11
+ X11
CFBundleIconFile
- X11.icns
+ X11.icns
CFBundleIdentifier
- org.x.X11
+ org.x.X11
CFBundleInfoDictionaryVersion
- 6.0
+ 6.0
CFBundleName
- X11
+ X11
CFBundlePackageType
- APPL
+ APPL
CFBundleShortVersionString
- 2.0
+ 2.2.0
CFBundleSignature
- x11a
+ x11a
CSResourcesFileMapped
-
+
NSHumanReadableCopyright
- Copyright © 2003-2007, Apple Inc.
-Copyright © 2003, XFree86 Project, Inc.
+ Copyright © 2003-2007, Apple Inc.
+Copyright © 2003, XFree86 Project, Inc.
+Copyright © 2003-2007, X.org Project, Inc.
+
NSMainNibFile
- main
+ main
NSPrincipalClass
- X11Application
+ X11Application
+ LSBackgroundOnly
+
diff --git a/hw/xquartz/bundle/bundle-main.c b/hw/xquartz/bundle/bundle-main.c
index 6f9744c2e..53f60a3e2 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 e091f25ba..299d9838d 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 e20c16b7a..87bcadac8 100644
--- a/hw/xquartz/quartzStartup.c
+++ b/hw/xquartz/quartzStartup.c
@@ -34,6 +34,7 @@
#include
#include
#include
+#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;
}