>>>> "Kazz" == Kazuyuki IENAGA
<ienaga(a)jsys.co.jp> writes: 
Kazz> Martin Buchholz <martin(a)xemacs.org> writes:
> If you have a recent Sun box, it is likely to come with fancy
24-bit
> video cards with names like `ffb' (fast frame buffer).
> 
> However, the default visual is only 8-bit.  This is a decision by Sun
> (mistaken, in my opinion) to improve backward compatibility with old
> apps.
> 
> A system administrator can change the default visual by copying
> /usr/dt/config/Xservers to /etc/dt/config and hacking it to add
> under-documented flags like -defdepth 24.  Few system administrators
> will be able to figure this out. 
Kazz> I've checked it with my neighbor's SPARC box (next to my desk :).
Kazz> When the default visual is 24 bit using Xsun with 
Kazz>     "/usr/openwin/bin/Xsun :0 -dev /dev/fb defdepth 24 -nobanner",
Kazz> both XEmacs 20.4 and 21.0-beta61 came up with TrueColor visual.
Kazz> Additionally, I've set no X resources at the time.
Kazz> (fyi: I could not use "-defdepth 24", but "-dev /dev/fb defdepth
24")
Congratulations!  You are one of the few who managed to get this to work.
> An application running in this kind of environment should be able
to
> recognize that the display is truly 24-bit and create 24-bit windows.
> For example, recent netscape's do this properly.  
> 
> xwininfo on a netscape window:
> Depth: 24
> Visual Class: TrueColor
> 
> xwininfo on a xemacs window:
> Depth: 8
> Visual Class: PseudoColor
> 
> As a result, display of images in XEmacs is noticeably suboptimal.
> How do we fix this? 
Kazz> Had you done `ps -aef | grep Xsun' and found "defdepth" was
specified?
Kazz> It seems like you're running Xsun at 8 bit depth.  How about your
Kazz> "depth of root window:" of "screen #0:"?
(martin@mulelab) ~ $ ps -ef | grep Xsun
    root  9984   457  1   1·î 20 ?       39:20 /usr/openwin/bin/Xsun :0 -nobanner -auth
/var/dt/A:0-a00079
Remember that 90% of all users don't customize their X server.  It's
horrible that Sun not only didn't make the 24-bit visual the default,
but didn't even document it in /usr/dt/config/Xservers, which is the
config file you have to hack.
Kazz> Anyway, even if the user doesn't run Xsun at 24 bit depth, the user
Kazz> can specify the depth using `xemacs -visual TrueColor24 -privatecolormap'.
Wow!  I didn't know you could do that!
It actually works for me using simply
xemacs -visual TrueColor24
Kazz> If you'd like to say that the XEmacs need to choose the best visual
Kazz> class when the X server had several kind of depths, my opinion is we
Kazz> just use default visual or do we use XMatchVisualInfo in descent order?
Kazz>    Status xvisualstat = FALSE;
Kazz>     /* 32 bit check */
Kazz>     xvisualstat = XMatchVisualInfo (dpy, screen, 32, DirectColor, &vinfo);
Kazz>     if ( xvisualstat == TRUE )
Kazz>       {
Kazz> 	....
Kazz>       }
Kazz>     /* 24 bit check */
Kazz>     /* 16 bit check */
Kazz>     /* 8 bit check */
My feeling is we should use the best visual available, not the default
visual.  Especially with the rapidly advancing technology in video cards.
Martin