On Wed, 14 Nov 2001, Gustaf Gunnarsson wrote:
> It sounds like a solution wich could work if you had access to the Xlib
> source. Problem here is that thoose applications run on a HPUX and it
> would be just a little too complicated process for me to fix that.
>
> I have one question though, what is the default colormap? If its the
> same as the active (I assume its not since you answered "default
> explicity") then it would never be a problem.
It's the colormap returned by XDefaultColormap. This is essentially
the root window colormap that all the applications are allocating
colors on. If the application doesn't want to allocate its own
map it uses the default. The default map for that screen is constant
from the time the server starts up and therefore is one of the
variables which are private to Xlib that got setup during XOpenDisplay.
The hack which I suggested made Xlib allocate a second map at
XOpenDisplay time and use that instead of the regular default map.
The result is that each client gets a private map instead of the
default map.
>
> But say, if the window manager kept track of whats been allocated for a
> certain window (or just whats not allocated when it started). Can it
> than unallocate thoose colors or can only the application do that?
The window manager doesn't know what colors have been allocated
on any particular colormap. It can read the contents of the whole
map but it doesn't know who allocated what. And even if it did,
it can't deallocate colors it didn't allocate itself.
It sounds like your apps might use XAllocColor instead of
XAllocColorCells (from the fact that they run with messed up
colors when the colormap gets allocated rather than failing).
In that case you might be able to change the default map to
StaticColor (a read-only map). Maybe your X-server lets you
change this? XFree86 does.
MArk.
_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert