public inbox for cygwin-xfree@sourceware.org
help / color / mirror / Atom feed
* reset/terminate problems; preventing multiple XWin instances
@ 2004-02-29  6:41 cygwinx2eran
  2004-02-29 13:49 ` Harold L Hunt II
  0 siblings, 1 reply; 10+ messages in thread
From: cygwinx2eran @ 2004-02-29  6:41 UTC (permalink / raw)
  To: cygwin-xfree

Hi,

First, I'd like to extend my gratitude and appreciation to the Cygwin/X 
developers. Your hard work has improved Cygwin/X by bounds and leaps, 
making it an increasingly attractive alternative to bloated and 
expensive commercial offerings. (Now if only multiwindow mode had decent 
performance, like the other two modes...)


A few issues I've encountered with Cygwin/X 4.3.0-47:

Issue #1:
In multiwindow mode, XWin doesn't reset when the last client exists.
Example:
   XWin :9 -terminate -multiwindow & sleep 5; DISPLAY=:9 xhost
XWin should terminate after 5 seconds, but it remains running.


Issue #2:
In the default mode, XWin sometimes terminates instead of resetting.
Example:
   XWin :9& sleep 5; DISPLAY=:9 xhost; sleep 5; DISPLAY=:9 xhost
XWin should reset after 5 seconds and again after 5 more seconds.
The first reset goes well, but on the second reset XWin usually terminates.


Issue #3:
Hoe does one write a batchfile that does "open an xterm window; run XWin 
first if necessary"? Being perhaps the most common usage case, such a 
batchfile should be bundled in the Cygwin/X package and mentioned in the 
documentation.
Note that /usr/X11R6/bin/startxwin.bat always runs a new instance of 
XWin, even if one is already running. This can result in inefficiency 
and confusion when the script is executed several times to open several 
xterm windows (a natural thing to do). It's made even worse by issue #1 
above.
Also, startxwin.bat doesn't use -clipboard.


   Eran


^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: reset/terminate problems; preventing multiple XWin instances
@ 2004-03-04 10:37 gkorte
  0 siblings, 0 replies; 10+ messages in thread
From: gkorte @ 2004-03-04 10:37 UTC (permalink / raw)
  To: cygwin-xfree

>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".

Hi Eran,

I had the same problem and have solved it with the following Batch file:
-------------
@echo off
SET DISPLAY=127.0.0.1:0.0
SET CYGWIN_ROOT=\cygwin
SET PATH=.;%CYGWIN_ROOT%\bin;%CYGWIN_ROOT%\usr\X11R6\bin;%PATH%

REM Find a running version of XWin
c:\progra~1\resour~1\pulist |c:\progra~1\resour~1\qgrep XWin >nul
REM if Xwin is running then start an Xterm
if errorlevel 1 goto NEXT 
run C:\cygwin\usr\X11R6\bin\xterm -cr red -sl 1000 -sb -rightbar -ms red 
-fg white -bg black -e /usr/bin/bash --login
goto END

:NEXT
REM Delete temp and lock file and start XWin and Xterm.
attrib -s %CYGWIN_ROOT%\tmp\.X11-unix\X0 >nul
del %CYGWIN_ROOT%\tmp\.X11-unix\X0 >nul
start C:\cygwin\usr\X11R6\bin\XWin.exe -multiplemonitors -multiwindow -dpi 
100 -clipboard
run C:\cygwin\usr\X11R6\bin\xterm -cr red -sl 1000 -sb -rightbar -ms red 
-fg white -bg black -e /usr/bin/bash --login
:END
---------------
You will need pulist and qgrep which is included in w2k resource kit. 
Should you not have this then please contact me offlist cygwin@nai.nu

Basically this batch file start Xwin if pulist (like ps but for windows) 
does not return a XWin process.

Hope this helps

-- 
Kind regards
Geordy Korte


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-03-04 15:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-29  6:41 reset/terminate problems; preventing multiple XWin instances cygwinx2eran
2004-02-29 13:49 ` Harold L Hunt II
2004-02-29 14:13   ` Eran Tromer
2004-02-29 14:23     ` Harold L Hunt II
2004-02-29 14:23     ` Takuma Murakami
2004-02-29 18:21       ` Harold L Hunt II
2004-03-03 21:54       ` cygwinx2eran
2004-03-04  9:02         ` Takuma Murakami
2004-03-04 15:11         ` Ehud Karni
2004-03-04 10:37 gkorte

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).