xwinwrap Utility Updated Version 3 February 2000 The version of xwinwrap provided here has been updated since the version published with the book. A new behavior has been added in order to work around a bug in the Java Plug-in for Netscape. The bug - an inability for Java applets to share a non-default colormap with the browser - is addressed by a new xwinwrap capability to force the same colormap to be used throughout a process hierarchy. The problem can be seen when Netscape is run with a private colormap: netscape -install If this Netscape instance runs a JDK1.2 applet using the Java Plug-in, that applet will not use Netscape's custom colormap; it will use the default root colormap. Sun has indicated that it does not plan to fix the problem, and offers the advice: "don't use the -install option". The new (optional) behavior of xwinwrap allows you to force the same non-default colormap to be used by Netscape and by processes (like the Java Plug-in) spawned by Netscape. The behavior is enabled by setting the XWINWRAP_SINGLEMAP environment variable. For example, the command: XWINWRAP_SINGLEMAP= LD_PRELOAD=xwinwrap.so netscape sets two environment variables (XWINWRAP_SINGLEMAP is set to an empty string, LD_PRELOAD points at the xwinwrap library) and runs Netscape without the "-install" option. This effectively solves the colormap problem: Netscape and the Java Plug-in will use the same private colormap. The xwinwrap utility is not limited to use with Netscape or Java. It's a general-purpose utility, usable with any X application, to provide control over visual and colormap usage that may not be provided by the application. See the discussion in chapter 56 for full details on its design and use. A subtlety about using XWINWRAP_SINGLEMAP: The XWINWRAP_SINGLEMAP behavior creates environment variables named XWINWRAP_SINGLEMAP_0, XWINWRAP_SINGLEMAP_1, ... up to the number of screens controlled by the X server. These variables are used to pass colormap ID from parent to child processes. There should not be any variables of the same name defined in the environment before application launch; if there are, they will interfere with XWINWRAP_SINGLEMAP behavior.