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 357132 - Setting an RGBA colormap using gtk_widget_set_colormap () on any widget at application start (before other widgets are used) causes the running app to revert to the stock icon theme
Setting an RGBA colormap using gtk_widget_set_colormap () on any widget at ap...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.10.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2006-09-22 00:42 UTC by Milosz Derezynski
Modified: 2011-02-04 16:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Testcase that demonstrates the described problem (does what is basically described in the report) (587 bytes, text/plain)
2006-09-22 00:46 UTC, Milosz Derezynski
  Details
This patch should fix the bug (1.25 KB, patch)
2006-09-22 19:17 UTC, Michael Natterer
committed Details | Review

Description Milosz Derezynski 2006-09-22 00:42:03 UTC
Please describe the problem:
(!!) NOTE This is only reproducible on composited displays, e.g. Xgl, or e.g. XFCE 4.4 beta + EXA + XFWM4..

1) Set up e.g. a GtkWindow *window;
2) Don't show it yet
3) Acquire an RGBA colormap using GdkColormap *map = gdk_screen_get_rgba_colormap ();
4) Set the colormap gtk_widget_set_colormap (window, colormap);
5) Set up some stuff that uses stock icons, e.g. a GtkMessageDialog

Result is: The dialog will have its icon theme reverted to the stock icons, which is in some way caused indirectly by using the RGBA-colormap-setting (Yeah i know it sounds on crack but please check the testcase out)

Steps to reproduce:
See above.

Actual results:
The app reverts to the stock icon theme.

Expected results:
Nothing except that the colormap should be set to the target widget.

Does this happen every time?
Yes.

Other information:
No other information except that this one's really on crack. LOL.
Comment 1 Milosz Derezynski 2006-09-22 00:46:20 UTC
Created attachment 73181 [details]
Testcase that demonstrates the described problem (does what is basically described in the report)

This testcase is basically almost less than trivial, yet it exposes the problem.

Steps to use/reproduce:

1) Use a _composited display_. Testing this has NO use on a non-composited display. Also you have to use a GTK+ theme that has custom stock icons (at least for GTK_STOCK_DIALOG_INFO and GTK_STOCK_OK), or the entire testcase is pointless.

2) Compile it with the usual gcc -o stylemess stylemess.c `pkg-config --libs --cflags gtk+-2.0`

3) Run it with: "./stylemess", it should show a window in the background (it's just there for technical reasons), and a dialog in the foreground. The dialog's icons should use icons from your current GTK+ theme.

4) Quit it and re-run it with e.g. (just supply some commandline arg): "./stylemess 1". Now the dialog will have reverted to the default/stock icons, and so will or would any subseqent widgets/dialogs in your app (as it was the case in BMP).
Comment 2 Milosz Derezynski 2006-09-22 00:53:33 UTC
This was tested to work, or rather, fail, on XFWM 4.4 beta + EXA + R2xx DRI driver + XOrg 7.0, as well as Xgl+Compiz
Comment 3 Michael Natterer 2006-09-22 19:17:11 UTC
Created attachment 73237 [details] [review]
This patch should fix the bug
Comment 4 Milosz Derezynski 2006-09-22 20:17:57 UTC
Confirmed, fixes it for me (setting the rgba colormap doesn't cause a reversal of the icon theme anymore)
Comment 5 Milosz Derezynski 2006-09-22 20:20:29 UTC
Tested with:

glib-2-12 HEAD
ATK_1_9_1 HEAD
cairo 1.2.4 
pango-1-14 HEAD
gtk-2-12 HEAD
+ mitch's patch


Comment 6 Michael Natterer 2006-09-22 20:48:01 UTC
Fixed in 2-10 and HEAD:

2006-09-22  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkstyle.c (gtk_style_real_copy): also copy icon factories
	and color hashes. Fixes bug #357132.