reset/terminate problems; preventing multiple XWin instances

Eran Tromer eran@tromer.org
Sun Feb 29 14:13:00 GMT 2004


On 2004-02-28 21:07, Harold L Hunt II wrote:

> > In multiwindow mode, XWin doesn't reset when the last client exists.
> It isn't supposed to. Run 'twm' as your window manager and you will
> see that the X Server does not reset when the last non-window manager
> client exits; this is because the window manager itself is a client.

ACK. I think this should be noted in the documentation -- I didn't
expect the "magical" window manager to count as a client.

As for preventing multiple instances of XWin, a kludgy way to do it is
by checking if anyone is listening on the X server port, using NETSTAT.
Example:

------------------------------
@echo off
rem Opens an xterm. Runs XWin first if needed.

set CYGWIN_ROOT=c:\cygwin
set DISPLAY_NUM=1

netstat -p tcp -a -n | %CYGWIN_ROOT%\bin\grep -E -q
    "^ +TCP +0\.0\.0\.0:600%DISPLAY_NUM% .* LISTENING"
set PATH=%CYGWIN_ROOT%\bin;%CYGWIN_ROOT%\usr\X11R6\bin
set HOME=
set DISPLAY=:%DISPLAY_NUM%
if not errorlevel 1 goto GOTX
start XWin %DISPLAY% -multiwindow -clipboard -dpi 96 -nowinkill
:GOTX
run xterm -ls -dpi 96
------------------------------

(Remove the linebreak from the the 'netstat' line above.)


BTW, -nounixkill seems to to be broken (Ctrl-Alt-Backspace still
terminates XWin).


   Eran



More information about the Cygwin-xfree mailing list