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 330154 - problems icon theme changes
problems icon theme changes
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: [obsolete] Preferred applications
git master
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-02-06 18:14 UTC by Christian Persch
Modified: 2006-02-28 21:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
default-applications-icon-theme-changes.patch (8.87 KB, patch)
2006-02-07 13:09 UTC, Luca Cavalli
none Details | Review
default-applications-icon-theme-changes-2nd.patch (9.42 KB, patch)
2006-02-07 20:38 UTC, Luca Cavalli
committed Details | Review

Description Christian Persch 2006-02-06 18:14:04 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.
Comment 1 Luca Cavalli 2006-02-07 13:09:07 UTC
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?
Comment 2 Christian Persch 2006-02-07 14:10:02 UTC
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)
Comment 3 Luca Cavalli 2006-02-07 16:06:20 UTC
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.
Comment 4 Christian Persch 2006-02-07 17:21:31 UTC
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.
Comment 5 Luca Cavalli 2006-02-07 20:38:10 UTC
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?
Comment 6 Luca Cavalli 2006-02-09 09:46:38 UTC
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?
Comment 7 Luca Cavalli 2006-02-11 23:03:56 UTC
Since unrelated to this patch, I have filed a bug report regarding the white background of combo box popup list. See bug #330840.