Enlightenment color Map Problem



My application do allocation in private color Map
and this work with fvwm and not with  Enlightenment as  WM
so it seem that  Enlightenment don't manage private colormap,
here find code to show it the problem
This problem occur when I have 256 colors on a PC RedHat5.2
and gnome distribution 0.99.7.

-first: we get the default colormap.

    depth = DefaultDepth(display, screen);
    default_visual = DefaultVisual(display, screen);

    colormap = DefaultColormap(display, screen);


-second: we allocate colors in default colormap as we can, if error, get
our
already allocated colors in default colormap in a own private colormap.
 exact_def is an array of colors we want to be allocated).

 ncolors = MAX_COLORS;
 for(i=0;i<MAX_COLORS;i++){
     if( !XAllocColor( display, colormap, &exact_defs[i] )){
        fprintf(stderr, "LST: can't allocate color %d in default
colormap\n", i );
        colormap = XCopyColormapAndFree(display, colormap); i--;
     }
 }

-third: create the windows with the attibute CWColormap set and the
colormap
which can be the default colormap our a private colormap depend on the
above
function.

    window_att.save_under = False; /* save_under; */
    if( backing_store )
        window_att.backing_store = WhenMapped;
        window_att.colormap = colormap;
        window_att.background_pixel = colors[background];
        valuemask = CWBackingStore|CWSaveUnder|CWColormap|CWBackPixel ;

         win = XCreateWindow( display, RootWindow(display,screen), x, y,
width, height,
                        0, CopyFromParent, InputOutput,
visual_info.visual,
                         valuemask, &window_att );
begin:          vcard
fn:             Gilles Noyer
n:              Noyer;Gilles
org:            Lectra Systèmes
adr:            ZI Marticot;;;Cestas;;33611;FRANCE
email;internet: g.noyer@lectra.com
title:          Ingenieur systèmes
tel;work:       +33 (0) 5 57 97 81 60 
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
version:        2.1
end:            vcard



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]