Fwd: Re: Various starting X problems

luke.kendall@cisra.canon.com.au luke.kendall@cisra.canon.com.au
Thu Apr 1 23:10:00 GMT 2004

I'm re-sending this since the mail server rejected the .zip attachment,
it seems:

			The Postfix program

<cygwin-xfree@cygwin.com>: host sources.redhat.com[] said: 552 we
    don't accept email with executable content (#5.3.4) (in reply to end of
    DATA command)

Instead, I'll just paste them inline.  Apologies for the length.


------ Forwarded message ------
         From: luke.kendall@cisra.canon.com.au
      Subject: Re: Various starting X problems
         Date: Thu, 1 Apr 2004 17:08:28 +1000 (EST)
           To: cygwin-xfree@cygwin.com

On 31 Mar, Harold L Hunt II wrote:
>  Luke,
>  luke.kendall@cisra.canon.com.au wrote:
> > Now with the workaround of knowing to run startx -- :0 to get X to
> > start, I thought I'd have a poke about to see what exactly makes it
> > crash.  I came up with several interesting problems.
> > 
> > In my .xinitrc I *don't* have an explicit path for xterm.  However, I
> > see xterm has moved from /usr/X11R6/bin to /usr/bin!  Did many other X
> > applications also move into there?
>  My system does not have a problem finding xterm in /usr/bin because 
>  /usr/bin should always be in your Cygwin shell path... something else is 
>  wrong with your Cygwin setup if that is not the case.

Hmm, okay.  /usr/bin and /bin and /usrX11R6/bin are all in my PATH. 
The error message is:

xinit:  No such file or directory (errno 2):  no program named "/usr/X11R6/bin/xterm" in PATH

Since there is no /usr/X11R6/bin/xterm (only a /usr/bin/xterm), I
suppose it's correct.  I haven't been able to find what it is that's
referencing the absolute path to the old location for xterm.

(It still seems strange to me that it moved to /usr/bin.)

> > I only noticed that xterm had moved because when I start X with
> > -multiwindow (or with -clipboard), it complains like this and exits:
> > 
> >     $ PATH="$PATH:/usr/X11R6/bin" startx -multiwindow -- :0
>  You shouldn't have to set the PATH to include /usr/X11R6/bin... as you 
>  said, it cannot find /usr/bin/xterm.

No, if it was asking for /usr/bin/xterm it would have been okay. 
Something is asking for /usr/X11R6/bin/xterm.

> >     XCOMM: not found
>  Oops... that isn't supposed to be in the startx script.  Those XCOMMs 
>  are supposed to be replaced with # signs at the beginning of the line. 
>  I've fixed this in a new version of the script.


> >     cat: /cygdrive/d/home/luke/.Xauthority: No such file or directory
> >     xinit:  No such file or directory (errno 2):  no program named "/usr/X11R6/bin/xterm" in PATH
>  Something else must be wrong with your path.

I don't think so.  FWIW, here is my full and ugly PATH, wrapped for
easy reading but no other changes:

/cygdrive/c/Program Files/nsr/bin:
/cygdrive/c/Program Files/Common Files/Adaptec Shared/System:
/cygdrive/c/Program Files/Canon/mport/bin:
/cygdrive/c/Program Files/Canon/mport/bin:
/cygdrive/c/Program Files/Canon/mport/bin:
/cygdrive/c/Program Files/Canon/mport/bin:
/cygdrive/c/Program Files/Canon/mport/bin:

Apart from some classically-stupid repetitions, and one complete stupid
and excessive repetition I didn't expect (mport), it seems functional
if inefficient.

>  I think you have a custom ~/.xinitrc or your /etc/X11/xinit/xinitrc has 
>  been modified.  Or, you might have ~/.xserverrc or 
>  /etc/X11/xinit/xserverrc (which are not installed by anything I have 
>  written).  Please send in any of these files if you find them so that we 
>  can see what they are doing.  For starters, they are obviously starting 
>  a window manager, which is not something that the version from 
>  X-startup-scripts-1.0.5-1 does.

I definitely have a custom .xinitrc file.  In fact part of our site
post-install process was to create a default one, since initially
Cygwin's XFree didn't include it.  I hadn't realised it was colliding
with one from Cygwin.  Our standard site post-install creates the
~/.xinitrc.  Sounds like I'd better try to back that out.

How much does Cygwin's XFree depend on the (traditionally)
user-controlled .xinitrc file, to work properly?  Does it also depend
on specific Cygwin things in ~/.Xresources?

I'll zip up and attach the files, anyway.  I've included an XWin.log
from a failure when started with -multiwindow.

Archive:  /u/luke/xwin.zip
  Length     Date   Time    Name
 --------    ----   ----    ----
     1698  04-01-04 14:22   .xinitrc
      509  11-06-02 17:31   .Xresources
      688  03-17-04 14:53   cygwin/startx.bat
     3857  04-01-04 14:25   cygwin/tmp/XWin.log
 --------                   -------
     6752                   4 files

> > So if I remove the "exec wmaker" from .xinitrc, X starts and stops
> > instantly.  So I add an "xterm" at the end of .xinitrc (since X doesn't
> > realise the wmaker would have started lots of windows from its saved
> > workspace state if it had been given a few seconds to run).
>  Yeah, you have to have a "magic client" that is started with an exec at 
>  the end of your .xinitrc, otherwise the behavior that you described is 
>  exactly what is supposed to happen.

Yep, I recognised the behaviour.

>  I think you can override the defaultserverargs in your .xinitrc so that 
>  you could have a .xinitrc that both starts its own wm and prevents 
>  startx from passing "-multiwindow" to XWin.exe.  I'm not an xinit/startx 
>  expert, so you'll have to look for docs on that elsewhere.

Are there any docs on -multiwindow and using the Windows desktop as
your window manager?

> > It looks like no window manager is running at all.
> > 
> > I wonder how I can run multiwindow with wmaker as my window manager?
> > Maybe keep the "exec wmaker" and set display to :1 ...  No, "startx
> > -multiwindow -- :1" triggers the "no program named
> > "/usr/X11R6/bin/xterm" in PATH" crash.  So I don't quite see how to
> > achieve that.  I tried xinit -multiwindow but that started up a full
> > desktop.
>  Seriously, the easiet way is to use startxwin.bat and modify it 
>  according to the instructions in that file.  Or, if you really want to 
>  start from a Cygwin shell, use startxwin.sh and modify it accorinding to 
>  its instructions.  There are pre-made lines that are just commented out 
>  that start a window manager etc.

Ah, yes, I knew there were some new startup scripts but I couldn't
remember what they were.  I'm still using the version of /startx.bat
that I modified, and pointed to from a desktop shortcut I've set up.

>  Lets have you try these things first and see where it goes.

Absolutely.  Thanks, Harold.

I tried startxwin.sh without a lot of joy.  I can't see where it gets
its starting set of windows, and I can't see how to start up any
windows conveniently either.  (Currently it has -multiwindow and
-clipboard hardwired in - it doesn't seem to do any argument

I may change that and send you a revised one, if you'd be interested.

Perhaps my question is, why would anyone choose to run multiwindow
using the Windows desktop?  There seems to be no easy way to start X
applications, except presumably from the command line.

It doesn't seem to use .xinitrc how I'd expect.  Sure, if I add an
"exec wmaker" then it all fails because it thinks a window manager (the
Windows desktop) is running, and bails out.  But if instead I add an
xmessage "Quit X" at the end instead, that never appears.  I just end
up with the "console window" with yellow text on black background, and
an icon in the Windows tray, that I can use to exit X or unhide the
root window.

If I unhide the root window, then the X cursor disappears.  Nor can you
call up a root menu, since I suppose Windows doesn't understand that.
And I know of no way to get a root menu in the Windows + multiwindow
"environment" or mode.

Also, as I said, if I unhide the root window in this mode you can't
exit from X.  You can request to do so, but it doesn't exit until you
rehide the root window.  You can also exit from the taskbar icon if you
have the root window hidden, but not if the root window is displayed.

Hope this makes some sense, and/or is of some use!

Oh: given that I had my own .xinitrc file, how can I get a copy of the
one Cygwin would have installed?  Move it aside and re-run setup?


----------------------- .xinitrc -------------------------
# $Xorg: xinitrc.cpp,v 1.3 2000/08/17 19:54:30 cpqbld Exp $


# merge in defaults and keymaps

if [ -f $sysresources ]; then
    xrdb -merge $sysresources

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap

if [ -f $userresources ]; then
    xrdb -merge $userresources

if [ -f $usermodmap ]; then
    xmodmap $usermodmap

# start some nice programs

DISPLAY="$DISPLAY.0" rxvt -sr -backspacekey ^? -g 80x45-65+0 -fn 9x15 -title "rxvt 1" &
xterm -sb -g 80x24+58-75 -fn 9x15 -title "xterm 2" &

#xclock -geometry 50x50-1+1 &
#xterm -g 72x12+0+75 -e /usr/local/script/mailprog-on-linux &

# Explanation of xterm arguments:
# -g means geometry: columns x lines (e.g. 80x23) followed first by a
# horizontal placement and 2nd by a vertical placement.  These placements
# are relative to the left (or top) if they start with a `+', and
# relative to the right (or bottom) if they start with a `-'.
# So 80x24+0-0 means 80 cols, 24 lines, 0 from the left edge of the screen,
# and 0 from the bottom.  The placements, incidentally, are in pixels. 
# -fn 9x15 means choose the 9x15 (in pixels) font. And 9x15bold is just that.
# You can resize windows with the mouse by dragging from the top-right
# icon of the title bar.  You can bring up the xterm font panel by holding
# down the CTRL key before you press the right mouse button down inside the
# xterm.  The left and middle things access other functions.

exec wmaker
#xmessage "Quit X"

----------------------- .Xresources -------------------------
! rxvt settings
rxvt*saveLines:	5000
rxvt*scrollBar:	on
rxvt*scrollTtyOutput:	off
rxvt*scrollTtyKeypress:	on
rxvt*cursorColor:	blue
!rxvt*ttyModes:		erase ^?
rxvt*background: white
rxvt*foreground: black
XTerm*saveLines:        2000
XTerm*scrollBar:        on
!XTerm*ttyModes: erase ^H
! Possible sizes include 6x13, 1x9, 7x13, 8x13, 9x15, 10x20, 12x24 - see
! usr/X11/lib/X11/fonts/misc...
XTerm*font: 9x15
*cursorColor: blue
*pointerColor: red
*scrollTtyOutput: false
*scrollKey: true

----------------------- cygwin/startx.bat -------------------------
@echo off

rem	The D: gets replaced by the real Cygwin drive during installation:

chdir \cygwin\bin

rem	For use with sample .profile: stop the exec in user's .profile for the
rem	case where we're really starting the X server.
set STARTX=df

rem 	Comment out the -rootless line if you *do* want the whole X desktop.
rem	-multiwindow had both hopeless performance and inability to get
rem	character input into an rxvt or xterm window under WindowMaker.

	bash --login -c "PATH=$PATH:/usr/X11R6/bin; startx"
rem	bash --login -c "PATH=$PATH:/usr/X11R6/bin; startx -- -rootless"
rem	bash --login -c "PATH=$PATH:/usr/X11R6/bin; startx -- -multiwindow"


----------------------- cygwin/tmp/XWin.logcygwin/tmp/XWin.logcygwin/tmp/XWin.log -------------------------
Welcome to the XWin X Server
Vendor: The Cygwin/X Project
Contact: cygwin-xfree@cygwin.com

XWin was started with the following command line:

XWin -multiwindow -clipboard 

ddxProcessArgument - Initializing default screens
winInitializeDefaultScreens - w 1024 h 768
winInitializeDefaultScreens - Returning
OsVendorInit - Creating bogus screen 0
winValidateArgs - g_iNumScreens: 1 iMaxConsecutiveScreen: 1
winDetectSupportedEngines - Windows NT/2000/XP
winDetectSupportedEngines - DirectDraw installed
winDetectSupportedEngines - DirectDraw4 installed
winDetectSupportedEngines - Returning, supported engines 00000007
winScreenInit - dwWidth: 1024 dwHeight: 768
winSetEngine - Multi Window => ShadowGDI
winAdjustVideoModeShadowGDI - Using Windows display depth of 32 bits per pixel
winCreateBoundingWindowWindowed - User w: 1024 h: 768
winCreateBoundingWindowWindowed - Current w: 1024 h: 768
winAdjustForAutoHide - Original WorkArea: 0 0 740 1024
winAdjustForAutoHide - Adjusted WorkArea: 0 0 740 1024
winCreateBoundingWindowWindowed - WindowClient w 1024 h 740 r 1024 l 0 b 740 t 0
winCreateBoundingWindowWindowed -  Returning
winAllocateFBShadowGDI - Creating DIB with width: 1024 height: 740 depth: 32
winAllocateFBShadowGDI - Dibsection width: 1024 height: 740 depth: 32 size image: 3031040
winAllocateFBShadowGDI - Created shadow stride: 1024
winFinishScreenInitFB - Masks: 00ff0000 0000ff00 000000ff
winInitVisualsShadowGDI - Masks 00ff0000 0000ff00 000000ff BPRGB 8 d 24 bpp 32
winCreateDefColormap - Deferring to fbCreateDefColormap ()
null screen fn ReparentWindow
null screen fn RestackWindow
winFinishScreenInitFB - Calling winInitWM.
InitQueue - Calling pthread_mutex_init
InitQueue - pthread_mutex_init returned
InitQueue - Calling pthread_cond_init
InitQueue - pthread_cond_init returned
winInitMultiWindowWM - Hello
winInitMultiWindowWM - Calling pthread_mutex_lock ()
winInitWM - Returning.
winFinishScreenInitFB - returning
winScreenInit - returning
winMultiWindowXMsgProc - Hello
winMultiWindowXMsgProc - Calling pthread_mutex_lock ()
InitOutput - Returning.
MIT-SHM extension disabled due to lack of kernel support
XFree86-Bigfont extension local-client optimization disabled due to lack of shared memory support in the kernel
(--) Setting autorepeat to delay=500, rate=31
(--) winConfigKeyboard - Layout: "00000409" (00000409) 
(EE) Keyboardlayout "US" (00000409) is unknown
Rules = "xfree86" Model = "pc101" Layout = "us" Variant = "(null)" Options = "(null)"
Couldn't load XKB keymap, falling back to pre-XKB keymap
Could not init font path element /usr/X11R6/lib/X11/fonts/CID/, removing from list!
winPointerWarpCursor - Discarding first warp: 512 370
winBlockHandler - Releasing pmServerStarted
winInitMultiWindowWM - pthread_mutex_lock () returned.
winMultiWindowXMsgProc - pthread_mutex_lock () returned.
winMultiWindowXMsgProc - pthread_mutex_unlock () returned.
winMultiWindowXMsgProc - DISPLAY=
winInitMultiWindowWM - pthread_mutex_unlock () returned.
winInitMultiWindowWM - DISPLAY=
winBlockHandler - pthread_mutex_unlock () returned
winProcEstablishConnection - Hello
winInitClipboard ()
winProcEstablishConnection - winInitClipboard returned.
winClipboardProc - Hello
DetectUnicodeSupport - Windows NT/2000/XP
winClipboardProc - DISPLAY=
winInitMultiWindowWM - XOpenDisplay () returned and successfully opened the display.
winMultiWindowXMsgProc - XOpenDisplay () returned and successfully opened the display.
winClipboardProc - XOpenDisplay () returned and successfully opened the display.
winClipboardWindowProc - WM_DRAWCLIPBOARD - Initializing - Returning.
winProcSetSelectionOwner - Clipboard not yet started, aborting.
winProcSetSelectionOwner - Clipboard not yet started, aborting.

More information about the Cygwin-xfree mailing list