This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Multiple XWin.exe programs loading and no xterm


On Fri, 8 Apr 2005, Phil Betts wrote:

> On Friday, April 08, 2005 3:58 PM, Igor Pechtchanski wrote:
>
> >Well, I don't recall if XWin has a way of selecting the next available
> >display (I do know it's not on by default, even if it exists), but that
> >would be pretty much a must in coping with an X service when one needs
> >to also start an XDMCP query, for example.
>
> Unless it's been slipped in quietly, I don't believe it does.  Even if
> it's possible, I think that until newbies stop running startxwin.bat
> in order to get an xterm, it's safer to leave this option well
> hidden, otherwise users will end up with 50 servers running at once
> and the list will be full of out-of-memory complaints!

Very true.  However, if this weren't default behavior, but the user needed
to supply an extra option (-picknextdisplay, for example, in the fine
tradition of X option naming) this would be very useful.

> >> I know zip about the issues involved in running as a Windows service,
> >> but if it's simple, it may be something to consider, perhaps as a
> >> default installation.
> >
> >It's pretty simple to start a program as a service.  One wouldn't want
> >to have it as a default option, certainly, but a config script akin to
> >that of other service packages (e.g., cron, openssh, cygserver, etc)
> >that *installs* such a service for the user to start would be very
> >useful.
>
> It wasn't the starting per se that I was concerned about.  I was
> wondering whether the exe would need to be changed.  I.e. XWin.exe is a
> Windows application (WinMain and all that), can *any* Windows
> application be started as a service, or do they need special
> initialisation code and/or linkage?  Is there not some issue over
> whether services can be interactive (which XWin certainly is)?

Interactive services can only run as SYSTEM, IIRC.  Other than that, the
precise goal of cygrunsrv was to allow any program to run as service,
without any special initialization code.  Given that XWin is a half
Windows/half Cygwin application (linked to both), there shouldn't be
problems with Cygwin ptys, etc.  The PATH for the service, of course,
should contain all the directories where the necessary libraries reside.

> >It would be trivial to write a "keepX" program that connects to the
> >server and does nothing (but is a client, so X stays around even if no
> >other clients are present).  If such a program were contributed to the
> >xorg packages (or, better yet, the upstream X distribution), the
> >default xinitrc could invoke it in the background before the xterm.
>
> An interesting idea.  If I get time this weekend I'll knock one up on
> Linux, but I'll only be able to test it on XWin on Monday.
>
> Surely its place would be in the foreground after starting xterm in
> the background.  startx quits when the xinitrc script has finished,
> not when the last client closes.  I.e. if your xinitrc ends like this:
>
>   xterm -title xterm1 &
>   exec xterm -title xterm2
>
> Closing xterm2 would close X (on Unix at least), regardless of whether
> xterm1 was still running or not.
>
> Changing this to:
>   xterm -title xterm1 &
>   xterm -title xterm2 &
>   exec keepX
> would leave you free to close either or both xterms without losing X.
> Only once keepX was killed would X close.

True.  I didn't think of that.

> This is getting a bit OT, but it strikes me that "keepX" would be a
> more logical place for the trayicon menu handling code.  If the icon
> is also an X window (or can be regarded as such by an X application),
> it should be relatively easy for an X client to attach a menu to it,
> and it would be easier to reconfigure a lightweight client than
> having to restart the server.  Comments?

As you said, an interesting idea... :-)  Unfortunately, if you use keepX
as the last client, restarting it will kill the server anyway...

In any case, the keepX utility, if it's ever written, should be submitted
to the upstream X.org project, so that it could be used by any X
implementation.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]