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 99276 - missing API: gdk_rgb_set_max_colors()
missing API: gdk_rgb_set_max_colors()
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Backend: X11
2.0.x
Other Linux
: Low normal
: Small API
Assigned To: gtk-bugs
gtk-bugs
: 100147 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2002-11-22 15:37 UTC by Sven Neumann
Modified: 2010-08-11 03:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch that implements gdk_rgb_set_max_colors() (1.94 KB, patch)
2002-11-22 15:39 UTC, Sven Neumann
needs-work Details | Review

Description Sven Neumann 2002-11-22 15:37:25 UTC
GdkRGB allows to set a minimum for the number of colors to allocate for a
pseudocolor display. I think it makes sense to add gdk_rgb_set_max_colors()
as well. There are cases where one wants to do special things with the
colormap and can't afford that GdkRGB allocates the largest possible
colorcube. This has already been described in bug #50294 and I also
stumpled across this limitation lately. I have added this function to my
tree and will attach the (trivial) patch. Please consider it for inclusion
in 2.2.
Comment 1 Sven Neumann 2002-11-22 15:39:45 UTC
Created attachment 12477 [details] [review]
patch that implements gdk_rgb_set_max_colors()
Comment 2 Owen Taylor 2002-11-25 17:34:34 UTC
Need to cut 2.4 off.

I suspect this should be per-colormap rather than global; if
it's to keep from hogging entries for other apps, then you
only care about the system colormap, if it's to split up
a private colormap, you only care about that colormap.

Also, an API function doesn't solve the problem in bug 50294,
unless the user is going to patch all their GTK+ apps.


Comment 3 Owen Taylor 2002-11-25 17:34:51 UTC
(That was, of course, meant to be "need to cut 2.2 off")
Comment 4 Owen Taylor 2002-12-03 02:10:24 UTC
*** Bug 100147 has been marked as a duplicate of this bug. ***
Comment 5 Brian Cameron 2002-12-03 18:32:47 UTC
It would be nice if there were some gtk configurion setting
(or environment variable) a user could set to specify the maximum
number of colors that all GTK+ apps would use, or perhaps to specify
that a smaller colorcube be used (say 2,2,2 rather than 6,6,6).
For example, ould this API be extended to also allow an environment
variable to cause this gdk_rgb_set_max_colors() to be called from
gtk_init()?

This way if a user wants to run some legacy application that sucks
up a lot of colors in 8-bit mode, and it is more important to that
user that the legacy application look nice at the expense of the
desktop, then the user would be able to get the effect that they
need.  There are some legacy applications that fit this category
(e.g. legacy CAD-CAM software).

Especially considering the user can setup their desktop to minimize
how bad the desktop looks in this situation (using a theme with few
colors, not use icons in menus, no background, etc.

Brian
Comment 6 Owen Taylor 2003-12-09 17:47:19 UTC
I could see adding a GtkSetting/XSETTING for this, though whether 
we get to this before the last 8-bit display dies of old age
seems doubtful...
Comment 7 Matthias Clasen 2010-08-11 03:23:33 UTC
gdkrgb is gone in gtk3