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: reset/terminate problems; preventing multiple XWin instances


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



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