This is the mail archive of the
cygwin-xfree@cygwin.com
mailing list for the Cygwin XFree86 project.
Re: reset/terminate problems; preventing multiple XWin instances
- From: Takuma Murakami <takuma at dgp dot ne dot jp>
- To: cygwin-xfree at cygwin dot com
- Date: Thu, 04 Mar 2004 18:02:02 +0900
- Subject: Re: reset/terminate problems; preventing multiple XWin instances
- References: <20040229140652.5D0A.TAKUMA@dgp.ne.jp> <404654C2.9010902@tromer.org>
- Reply-to: cygwin-xfree at cygwin dot com
Eran,
> On 29-02-2004 14:11, Takuma Murakami wrote:
>
> >> As for preventing multiple instances of XWin
> > This feature is already implemented in my local tree (not
> > port based but mutex based detection).
>
> I see that it's in 4.3.0-50 and working well, but I don't see how the
> current implementation addresses the common task I mentioned:
> "open an xterm; run XWin first if needed"
> If I use a batchfile that always runs XWin and then xterm, from the 2nd
> invocation onwards it will produce the error popup reporting a "Fatal
> error" and directing me a to log file... Not quite what's needed here.[1]
>
> Perhaps there should be a switch that says "if the display already
> exists, exit silently".
I agree. We should have an option like "-silent" or "-quiet".
> But that doesn't solve the case where I want to run additional programs
> (say, twm and xeyes) whenever a new display is created -- again a common
> scenario, I believe. One way to solve this is to add an option for
> checking the presence of an XWin instance on the given display number
> and exiting immediately with a corresponding errorcode; a batchfile can
> then check for the existance of an XWin instance, and if negative spawn
> XWin and related stuff. But this could lead to a race condition if two
> batchfiles do the check simultaneously. An alternative is to add an
> option for XWin to run some executable iff its startup succeeded.
Let's suppose Cygwin/X has -silent option as above: then I
think startxwin.bat with -silent option is sufficient for your
purpose. It will start a server (which silently fails if there
is the other) and then start some favorite applications.
Takuma Murakami