<qandadiv id="modular">
<title>Upgrade</title>

<qandaentry> 
<question id="q-x-is-broke">
<para>What happened to my X server? Where did <filename class="directory">/usr/X11R6/</filename> go?
</para>
</question>
<answer>
<para>The upgrade from X.Org R6.8 to modular X.Org R7.4 made a lot of changes.
Please
<ulink url="http://cygwin.com/ml/cygwin-xfree-announce/2008-11/msg00000.html">
read the announce email</ulink>
and pay attention to the upgrade instructions
</para>
</answer>
</qandaentry>

<qandaentry> 
<question id="q-i-cant-type-anything">
<para>I upgraded my X server and now I can't type anything into any X application</para>
</question>
<answer>
<para>This question should be obsolete.</para>
<para>
Launch the X server via the shortcut under "Cygwin-X" on the start menu. 
</para>
<para>
Technical details: The <command>startxwin.bat</command> script used to set several enviroment
variables used by the X server to specify the location of files it needs to access.  Specifically 
this batch file would set <parameter>XKEYSYMDB</parameter> to <filename>/usr/X11R6/lib/X11/XKeysymDB</filename>.
This file was moved to <filename>/usr/share/X11/XKeysymDB</filename>.
The keyboard won't work if <parameter>XKEYSYMDB</parameter> points to a non-existent file.
</para>
<para>
If you are (perhaps unintentionally) using a copy of the old <command>startxwin.bat</command> (perhaps under another name) to start the X server, remove the environment variables <parameter>XAPPLRESDIR</parameter>, <parameter>XCMSDB</parameter>, <parameter>XNLSPATH</parameter> and <parameter>XKEYSYMDB</parameter> from it, or (preferrably)
use the updated <command>startxwin</command>.
</para>
<para>
If <command>echo $XKEYSYMDB</command> outputs something, you have something else setting <parameter>XKEYSYMDB</parameter> in your environment.  Find it and remove it.
</para>
<para>These variables were always being set to the defaults, so they can simply be removed.
See <xref linkend="microsoft-services-for-unix"/> for the reason why you
might need to set them.</para>

</answer>
</qandaentry> 

<qandaentry> 
<question id="q-whereis-startxwin-bat">
<para>I can't find <command>startxwin.bat</command> or <command>startxwin.exe</command> to start the X server</para>
</question>
<answer>
<para>
The executable <command>startxwin.exe</command> previously used to start the X server
has been retired and replaced with a shell script <command>startxwin</command>.
</para>
<para>
The MS-DOS batch file <command>startxwin.bat</command> previously used to start the X server
has been retired, as implementing this as a batch file
made it difficult to reliably wait until the the X server had started before
starting any clients.
</para>
<para>
X.Org now uses the prefix <filename class="directory">/usr</filename> not <filename class="directory">/usr/X11R6</filename>. So <command>startxwin.bat</command>
was moved from <filename>/usr/X11R6/bin/startxwin.bat</filename> to
<filename>/usr/bin/startxwin.bat</filename>.
</para>
<para>
A "XWin Server" shortcut to <command>startxwin</command> is created on the Start menu, under "Cygwin-X"
</para>
<para>
<command>startxwin</command> and the Start menu link to it are now installed by the <filename>xinit</filename> package.
</para>
</answer>
</qandaentry>

<qandaentry>
<question id="q-moved-1">
<para>Moved question</para>
</question>
</qandaentry>

<qandaentry> 
<question id="q-where-are-my-fonts">
<para>My favourite font has gone! The font Emacs uses is just boxes</para>
</question>
<answer>
<para>
Only minimal fonts will be installed after the upgrade from X.Org R6.8 to modular X.Org.
</para>

<para>
Font packages are now named <filename>font-&lt;author/class&gt;-&lt;fonttype&gt;</filename>
</para>

<para>
Some packages dependencies have not yet been updated for the fonts they
require, so you may need to manually install the needed fonts.  For example,
to provide the font emacs wants to use by default you will probably want
to install <filename>font-adobe-dpi75</filename>
(or <filename>font-adobe-dpi100</filename> if you like large fonts).
This package provides the <parameter>courier</parameter>, 
<parameter>helvetica</parameter>,
<parameter>new century schoolbook</parameter>
and <parameter>times</parameter> font families.
</para>

<para>
The <parameter>lucida</parameter> font family is provided by the package
<filename>font-bh-dpi75</filename>
(or <filename>font-bh-dpi100</filename>).
The monospaced version, <parameter>lucida typewriter</parameter> is provided by the package
<filename>font-bh-lucidatypewriter-dpi75</filename>
(or <filename>font-bh-lucidatypewriter-dpi100</filename>).
</para>

<para>
Note that after installing fonts you will need to restart the X server or run
<command>xset fp default; xset fp rehash</command> to make the new fonts available
</para>
</answer>
</qandaentry>

<qandaentry> 
<question id="q-where-is-xxyzy">
<para>Where has <command>xhost</command>/<command>xlsfonts</command>/etc. gone?</para>
</question>
<answer>
<para>Previously all the X utility programs were contained in a single package, <filename>xorg-x11-bin</filename>, which needed to be updated when any of the programs it contained was updated.  In modular X each of these programs can be found in a separate package, usually named <command>xhost</command>/<command>xlsfont</command>/etc.</para>
</answer>
</qandaentry>

<qandaentry> 
<question id="q-how-do-i-get-rid-of-xterm-menu">
<para>How do I get rid of that menu at the top of my xterm?</para>
</question>
<answer>
<para>Run it as <command>xterm +tb</command>, or add <parameter>XTerm*toolBar: false</parameter> to <filename>~/.Xresources</filename></para>
</answer>
</qandaentry>

<qandaentry> 
<question id="q-ssh-y">
<para>ssh -X now says "Warning: untrusted X11 forwarding setup failed: xauth key data not generated"</para>
</question>
<answer>
<para>See <xref linkend="q-ssh-no-x11forwarding"/> and following.  See <ulink url="http://cygwin.com/ml/cygwin-xfree/2008-11/msg00154.html">point 3 in this mail</ulink>.  Use ssh -Y.</para>
<para>Technical details: ssh tried to run <command>xauth generate</command> to create a untrusted cookie for the session, which failed because the server isn't compiled with the XCSECURITY extension built-in.</para>
</answer>
</qandaentry>

<qandaentry> 
<question id="q-nedit-wont-start">
<para>
<command>nedit</command> fails to start with an error message 
</para>
</question>
<answer>
<para>This question should be obsolete.</para>
<para>
<screen>
$ nedit
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  70 (X_PolyFillRectangle)
  Serial number of failed request:  some number
  Current serial number in output stream:  some other number
</screen>
<command>nedit</command> needs rebuilding with a patch to work around an issue <filename>lesstif</filename>
has with current X servers.
</para>
<para>
Until this happemns, you can work around the issue by adding <parameter>XLIB_SKIP_ARGB_VISUALS</parameter>
to your enviroment, e.g.
<screen>
$ export XLIB_SKIP_ARGB_VISUALS=1
$ nedit
</screen>
</para>
</answer>
</qandaentry>

<qandaentry>
<question id="q-startx-is-has-root-window">
<para>
I start my X server with <command>startx</command> or <command>xinit</command> and now all my X windows are contained within one large root Windows window?  How do I get it back to each X window in it's own Windows window?
</para>
</question>
<answer>
<para>
This is a deliberate change from Cygwin/X X11 R6.9 behaviour.
</para>
<para>

<orderedlist spacing="compact">

<listitem>
<para>
Start the X server using the "XWin Server" shortcut under "Cygwin-X" on the Start menu, or using <command>startxwin</command>.
</para>

<para>
Note: If you wish to customize the X clients started when the X server starts, 
you can do so using a <filename>~/.startxwinrc</filename> script.
</para>
</listitem>

<listitem>
<para>Alternatively, add the server option <parameter>-multiwindow</parameter> to your <command>xinit</command> or <command>startx</command> invocation, i.e. <command>xinit -- -multiwindow</command> or <command>startx -- -multiwindow</command></para>
</listitem>

<listitem>
<para>Alternatively, put <command>XWin -multiwindow</command> into <filename>~/.xserverrc</filename> or <filename>/etc/X11/xinit/xserverrc</filename></para>
</listitem>

</orderedlist>

</para>
</answer>
</qandaentry>

<qandaentry>
<question id="q-moved-2">
<para>Moved question</para>
</question>
</qandaentry>

<qandaentry>
<question id="q-startxwinrc-exit">
<para>I upgraded and now X exits immediately after starting</para>
</question>

<answer>
<para>
Since <filename>xinit-1.3.4-1</filename>, <command>startxwin</command> is now
implemented by a script based on <command>startx</command>.  Unfortunately, this
has changed the behaviour in a backwards-incompatible way, as the X server is
now killed when <filename>~/.startxwinrc</filename> exits.
</para>

<para>
If you have an empty <filename>~/.startxwinrc</filename>, you should change it
to contain <command>exec sleep infinity</command> so the X server will not exit
until explicitly told to do so.
</para>

<para>
If you are using a custom <filename>~/.startxwinrc</filename>, either run the
last client in the foreground (i.e. without <command>&</command>), so the X
server exits when that client exits, or use <command>exec sleep
infinity</command> as described above.
</para>

<para>
You should also make sure that <filename>~/.startxwinrc</filename> is executable
(e.g. <command>chmod +x ~/.startxwinrc</command>).
</para>

<para>
See <ulink url="https://cygwin.com/ml/cygwin-xfree-announce/2014-11/msg00004.html">
the announce mail</ulink> for more details.
</para>

</answer>
</qandaentry>

<qandaentry>
<question id="q-xserver-nolisten-tcp-default">
<para>I upgraded and now X clients can't connect</para>
</question>

<answer>
<label>A1:</label>
<para>
Since X server 1.17, by default the server does not listen for TCP/IP
connections, only accepting local connections on a unix domain socket.
</para>
<para>
For local clients, use <command>DISPLAY=:0.0</command>, rather than
<command>DISPLAY=localhost:0.0</command>,
<command>DISPLAY=127.0.0.1:0.0</command> or <command>DISPLAY=::1:0.0</command>.
See <xref linkend="display-and-screen"/>.
</para>
</answer>

<answer>
<label>A2:</label>
<para>
For remote clients, rather than connecting over TCP/IP by explicitly setting
<parameter>DISPLAY</parameter> and allowing access using
<command>xhost</command> or by disabling access control, use ssh tunnelling with
<command>ssh -Y</command> instead.  (See the User's Guide section <ulink
url="http://x.cygwin.com/docs/ug/using-remote-apps.html#using-remote-apps-ssh">on
X forwarding using ssh</ulink> for more details).
</para>
</answer>

<answer>
<label>A3:</label>
<para>
Use the <parameter>-listen tcp</parameter> option to restore the previous
behaviour, allowing the X server to open a TCP/IP socket as well
e.g. <command>startxwin -- -listen tcp</command>.
See <xref linkend="q-command-line-args"/>.
</para>
</answer>

</qandaentry>

</qandadiv>
