GNOME Bugzilla – Bug 330154
problems icon theme changes
Last modified: 2006-02-28 21:03:56 UTC
in gnome-da-capplet.c:show_dialog(): theme = gtk_icon_theme_get_default (); g_signal_connect (theme, "changed", G_CALLBACK (theme_changed_cb), capplet->xml); theme_changed_cb (theme, capplet->xml); This listens to the wrong icon theme after you've moved the widget to a different screen. I think you need to connect to "screen-changed" and attach to the correct icon theme from there. And the icons in the comboboxes aren't updated on theme change.
Created attachment 58856 [details] [review] default-applications-icon-theme-changes.patch I have prepared a patch that should solve both the problems (btw, there was a TODO in my code to remember me to add theme changing support also for combo box icons). I'm not sure I handle it the correct way, I haven't found a lot of code to *take inspiration* from :). Christian, can you look at the patch and tell me if I'm going in the right direction (look at screen_changed_cb), please?
screen_changed_cb looks ok, I do about the same thing in ephy-spinner.c. I'd just call theme_changed_cb directly instead of + g_signal_emit_by_name (theme, "changed", capplet); though. + theme = gtk_icon_theme_get_default (); + capplet->icon_theme = theme; + g_signal_connect (theme, "changed", G_CALLBACK (theme_changed_cb), capplet); + g_signal_emit_by_name (theme, "changed", capplet); I think this might be unnecessary, don't you always get a screen-changed signal on startup? (then you need to guard against NULL capplet->theme in screen_changed_cb)
That is quite strange. I'm not receiving any screen-changed signal at startup. Am I connecting to the signal too late? I can't find any specific info about when exactly the signal is emitted. If I remove the explicit connection to theme change signal in show_dialog() I have to manually force a screen-changed signal, otherwise no icons at all.
In my widget I use the class closure for it, and it's called... but if it isn't for you, you can just call the callback once before connecting the signal.
Created attachment 58884 [details] [review] default-applications-icon-theme-changes-2nd.patch I made a new patch following Christain's advices. I have also added a fallback theme = gtk_icon_theme_get_default in case theme == NULL in gnome-da-capplet.c:fill_combo_box(). One final issue to solve now: when I switch my theme icon-set to a different one the combo boxes drop down menu has white background instead of the theme default color background. Anyone can reproduce it?
As for the white background of combo box drop down menu I have done some research. I made a very simple test app with just a combo box filled by some icons taken from default theme, without any signal connected to. Same problem. Same problem also with other apps (tested with GIMP 2.3.6 (Colors->Components->Channel Mixer)). The problem seems unrelated to my patch, so should be safe to apply it. Any ideas?
Since unrelated to this patch, I have filed a bug report regarding the white background of combo box popup list. See bug #330840.