On Wed, 14 Nov 2001, Gustaf Gunnarsson wrote:
> Hi,
> I am running several color hungry applications on an 8-bit (PseudoColor) X-terminal.
>None of thoose applications use a private colormap wich makes the last applications
>display weird colors. I want to know if it is possible to assign a read/writeable
>colormap to a program (or window) when it starts up without having it requesting that
>it itself by modifying my window manager or writing some kind of wrapper.
>
The app most likely is allocating colors in the default map
explicitly. I don't think there's anything the window manager
can do there. Maybe you could hack Xlib to create a private
colormap and replace the screen structure's default colormap
with that when a particular environment variable was set.
Actually, that sounds like an interesting feature to add
to the end of XOpenDisplay. If the environment variable
is set call XCreateColormap with the root window of the
default screen and using the default visual. Replace the
default colormap with that. I suppose it looks something
like:
if(getenv("XLIB_FORCE_PRIVATE_MAP")) {
Colormap cmap = XCreateColormap(dpy,
dpy->screens[dpy->default_screen].root,
dpy->screens[dpy->default_screen].root_visualID,
AllocNone);
dpy->screens[dpy->default_screen].cmap = cmap;
}
Or something along that lines stuck at the very end of XOpenDisplay.
Might work.
Mark.
_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert