After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 100147 - gtk+ uses up many colors needlessly
gtk+ uses up many colors needlessly
Status: RESOLVED DUPLICATE of bug 99276
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other All
: Normal major
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2002-12-02 17:24 UTC by Brian Cameron
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.0



Description Brian Cameron 2002-12-02 17:24:19 UTC
We are noticing that programs that use a lot of colors do not run well
on Solaris in 8-bit color mode.  In this situation there are not enough
colors for the programs and you get that ugly colormap flashing effect
(where if you move the pointer into the window all applications outside
the window change to ugly colors, and vice versa).  In addition, there 
are sometimes not enough colors for the program to use, so incorrect
alternatives are sometimes chosen.

A workaround is to use a 24-bit video card.  However programs run slower
in 24-bit mode, which is undesirable to some users.  Also, some users
have 8-bit only graphics cards.

I did the following to see what Gnome program was using up all the colors:

1. Set the background to "no background"
2. Told Nautilus to not draw the desktop.
3. Set the theme to Bright, which is a flat theme.  Then I set the gtk+
   theme to high contrast so everything is just black & white.  This
   was probably unnecessary since the next step (#4) stopped nautilus from
   even running, but just being careful.
4. I chmod'ed gnome-panel and metacity so that they aren't executable.
   (actually I had to move metacity to a different name and create a
   shell executable that didn't do anything with the name metacity so
   gnome-session didn't notice the failure and default to dtsession).
5. I logged into my session using Failsafe.

So, this all means that I had nothing visible running and a completely
black background aside from the single terminal that is automatically
started with Failsafe mode.  This single window obviously had no window
manager since metacity wasn't running.

Even doing all of the above, the program still did not have enough
colors to display properly.

This leads me to believe that some gtk-init functionality is grabbing
colors, perhaps for later use?  

Any ideas regarding why Gnome programs use up so many colors, even when
nothing is displayed on the screen?
Comment 1 Brian Cameron 2002-12-02 17:58:23 UTC
Here is more information about the workaround that can be used,
though it does slow down the program:

"A workaround is to use a 24-bit video card and the default 24
bit visual (by using "defdepth 24" Xserver setting in
/usr/dt/config/Xservers or in /etc/dt/config/Xservers on Sun
systems)."

For a more detailed explanation, you may want to refer to the
"How can I stop color flashing" item in this FAQ:

http://www.sun.com/bigadmin/xperts/sessions/02_sunpci/

Also, here's something from Alan Coopersmith on this issue:

http://groups.google.com/groups?q=%22defdepth+24%22+Xservers&hl=en&lr=&ie=UTF-8&scoring=d&selm=asf48c%245kc%241%40agate.berkeley.edu&rnum=1
Comment 2 Owen Taylor 2002-12-03 02:10:27 UTC
Probably the stock icons that are causing the colormap to
be allocated ... even if the high-contrast icons
are grayscale, GTK+ doesn't really know that. They are just
icons that happen to have only shades of gray, so the 
full GdkRGB color cube needs to be allocated.

*** This bug has been marked as a duplicate of 99276 ***