XQuartz: Fixed "Multiple Dock Icons"

BAM!
This commit is contained in:
Jeremy Huddleston 2007-12-08 00:13:47 -08:00
parent 6b74c535dc
commit 0502955a2a
5 changed files with 52 additions and 47 deletions

View file

@ -30,6 +30,7 @@ libXquartz_la_SOURCES = \
quartz.c \
quartzAudio.c \
quartzCocoa.m \
quartzForeground.c \
quartzKeyboard.c \
quartzPasteboard.c \
quartzStartup.c
@ -47,5 +48,6 @@ EXTRA_DIST = \
quartzCommon.h \
quartzCursor.c \
quartzCursor.h \
quartzForeground.h \
quartz.h \
quartzPasteboard.h

View file

@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.1.0</string>
<string>2.1.1</string>
<key>CFBundleSignature</key>
<string>x11a</string>
<key>CSResourcesFileMapped</key>
@ -33,5 +33,7 @@ Copyright © 2003-2007, X.org Project, Inc.
<string>main</string>
<key>NSPrincipalClass</key>
<string>X11Application</string>
<key>LSBackgroundOnly</key>
<true/>
</dict>
</plist>

View file

@ -37,34 +37,31 @@ int launcher_main(int argc, char **argv);
int server_main(int argc, char **argv);
int main(int argc, char **argv) {
Display *display;
int launchd = 0;
size_t i;
int retval;
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]);
fprintf(stderr, "\targv[%u] = %s\n", (unsigned)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);
for(i=1; i < argc; i++) {
if(!strncmp(argv[i], "-launchd", 8)) {
launchd = 1;
break;
}
}
/* 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: main(): closing the display");
/* Could open the display, start the launcher */
XCloseDisplay(display);
/* Start the server */
fprintf(stderr, "X11.app: main(): running server_main()");
retval = server_main(argc, argv);
if(retval != 0)
return retval;
/* If we weren't started by launcd, then run the launcher. */
if(!launchd) {
/* Give 2 seconds for the server to start...
* TODO: *Really* fix this race condition
*/
@ -72,11 +69,7 @@ int main(int argc, char **argv) {
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()");
return server_main(argc, argv);
return 0;
}

View file

@ -708,6 +708,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;

View file

@ -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;
}