Scoring visuals in GdkRGB



The context of this mail is

	http://bugzilla.gnome.org/show_bug.cgi?id=86540

Basically, there are machines where the maximum visual depth is 8, the
system visual is 8-bit pseudocolor, but there are 8-bit truecolor
visuals available.

Here, gdk_rgb_score_visual() would give the same score to the 8-bit
pseudocolor and 8-bit truecolor visuals, but it gives preference to the
system visual and thus picks the 8-bit pseudocolor one.  It allocates
its 6x6x6 color cube, leaving few colormap entries available for
non-GNOME applications, and so causing the usual sort of problems when
you run out of colormap entries.

Since GdkRGB would be allocating a color cube, anyways, doesn't it make
sense for it to give preference to truecolor visuals even if they are 8
bits deep?  The 8-bit truecolor visual will have a color cube of its
own.  GNOME would run in the truecolor visual, leaving the pseudocolor
system visual nearly empty for use by other apps.

E.g. I would like to change the last two lines of

  if (visual->type == GDK_VISUAL_TRUE_COLOR ||
      visual->type == GDK_VISUAL_DIRECT_COLOR)
    {
      if (visual->depth == 24)
	{
	  quality = 9;
	  /* Should test for MSB visual here, and set speed if so. */
	}
      else if (visual->depth == 16)
	quality = 8;
      else if (visual->depth == 15)
	quality = 7;
      else if (visual->depth == 8)
	quality = 4;
    }

to
      else if (visual->depth) == 8)
	quality = 5;

This would give preference to the truecolor visual over the pseudocolor
one, which gets a score of 4.  You would not get exact grays, but you
are missing many things in life with an 8-bit video card anyways.

  Federico



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