Re: RFC: Combining both X11.apps into one
Re: RFC: Combining both X11.apps into one
- Subject: Re: RFC: Combining both X11.apps into one
- From: Jeremy Huddleston <email@hidden>
- Date: Mon, 3 Dec 2007 17:19:49 -0800
I have not looked at it, but what does it do in the event that a user
launches X11 by double-clicking on the X11.app icon
Assuming they haven't done anything wonky, this just causes 'xterm' to
be executed (like currently). Launchd then executed '/A/U/X11.app/C/M/
X11 --launchd' instead of '/u/X/X11.app/C/M/X11'.
Additionally, if the user disables launchd support, double clicking /A/
U/X11.app will behave as Tiger did.
and then, in a
Terminal.app window does ssh -X <somewhere>?
same as it does now. This didn't change.
I believe that the original
problem was that another instance of X11.app would then launch with a
different DISPLAY.
Ok, I see what you're getting at here. That will only be the case if
the user disables launchd support. This just rolls /u/X/X11.app into /
A/U/X11.app and executes the /u/X version if command line arguments
are given (like launchd or people starting it via command line for
various reasons) or if it can't connect to a DISPLAY (such as when you
disable launchd support for the "Tiger Way"). Here's the core of
it... pretty straightforward:
int main(int argc, char **argv) {
Display *display;
/* If we have command line arguments, assume we want a server */
if(argc > 1) {
if(strncmp(argv[1], "--launchd", 9) == 0) {
argc--;
argv[1] = argv[0];
argv++;
}
return server_main(argc, argv);
}
/* Now, try to open a display, if so, run the launcher */
display = XOpenDisplay(NULL);
if(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);
return launcher_main(argc, argv);
}
/* Couldn't open the display, assume we just want to start a
server */
return server_main(argc, argv);
}Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden