GNOME Bugzilla – Bug 100147
gtk+ uses up many colors needlessly
Last modified: 2004-12-22 21:47:04 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?
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
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 ***