Index of /JavaLinux/CDROM/Chapter56/xwinwrap
Name Last modified Size Description
Parent Directory -
CVS/ 06-Nov-2006 21:56 -
Makefile 09-Nov-1999 13:15 282
README.txt 04-Feb-2000 08:12 2.2K
xwinwrap.c 03-Feb-2000 21:01 8.5K
xwinwrap.old.c 12-Nov-1999 01:05 7.6K
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.