GNOME Bugzilla – Bug 99276
missing API: gdk_rgb_set_max_colors()
Last modified: 2010-08-11 03:23:33 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.
Created attachment 12477 [details] [review] patch that implements gdk_rgb_set_max_colors()
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.
(That was, of course, meant to be "need to cut 2.2 off")
*** Bug 100147 has been marked as a duplicate of this bug. ***
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
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...
gdkrgb is gone in gtk3