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

@ -3,35 +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.1.0</string>
<string>2.1.1</string>
<key>CFBundleSignature</key>
<string>x11a</string>
<string>x11a</string>
<key>CSResourcesFileMapped</key>
<true/>
<true/>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2003-2007, Apple Inc.
<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>

View File

@ -37,46 +37,39 @@ 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);
}
/* 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);
/* Give 2 seconds for the server to start...
* TODO: *Really* fix this race condition
*/
usleep(2000);
fprintf(stderr, "X11.app: main(): running launcher_main()");
return launcher_main(argc, argv);
for(i=1; i < argc; i++) {
if(!strncmp(argv[i], "-launchd", 8)) {
launchd = 1;
break;
}
}
/* Couldn't open the display or we were called with arguments,
* just want to start a server.
*/
/* Start the server */
fprintf(stderr, "X11.app: main(): running server_main()");
return server_main(argc, argv);
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
*/
usleep(2000);
fprintf(stderr, "X11.app: main(): running launcher_main()");
return launcher_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;
}