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 680926 - generic type fallback logic is broken for -symbolic
generic type fallback logic is broken for -symbolic
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other Linux
: Normal normal
: Small fix
Assigned To: gtk-bugs
gtk-bugs
: 685931 704952 (view as bug list)
Depends on:
Blocks: 682886
 
 
Reported: 2012-07-31 17:32 UTC by Jakub Steiner
Modified: 2013-10-28 22:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
icontheme: correctly fallback to symbolic icons (2.68 KB, patch)
2013-08-13 13:45 UTC, Cosimo Cecchi
committed Details | Review
themedicon: correctly fallback to symbolic icons (2.37 KB, patch)
2013-08-13 13:45 UTC, Cosimo Cecchi
committed Details | Review

Description Jakub Steiner 2012-07-31 17:32:16 UTC
Attaching a usb drive for example exposed a tango styled usb drive icon in nautilus' sidebar. This happens because drive-harddisk-usb-symbolic is missing, and drive-harddisk-usb is being looked up, rather than drive-harddisk-symbolic.

Right now we have to provide a -symbolic variant for every icon added to -extras (specific devices, mimetypes).
Comment 1 Jakub Steiner 2012-08-01 13:50:04 UTC
reassigning to gtk+/cosimo to implement a symbolic fallback.
Comment 2 Matthias Clasen 2012-08-06 23:36:51 UTC
This is really just a consequence of the decision to put symbolic icons into the same theme as regular icons.
Comment 3 Cosimo Cecchi 2012-10-16 00:41:20 UTC
*** Bug 685931 has been marked as a duplicate of this bug. ***
Comment 4 Cosimo Cecchi 2013-08-13 12:37:28 UTC
*** Bug 704952 has been marked as a duplicate of this bug. ***
Comment 5 Cosimo Cecchi 2013-08-13 13:45:10 UTC
Created attachment 251498 [details] [review]
icontheme: correctly fallback to symbolic icons

When an icon is requested as symbolic, our generic fallback algorithm
uses fullcolor icons when the specified icon name is not found, treating
the "-symbolic" suffix as another component of the icon name.

Change the algorithm to check beforehand if the icon is symbolic, remove
the suffix if so, and re-add it at the end for all the generated icon
names.
Comment 6 Cosimo Cecchi 2013-08-13 13:45:13 UTC
Created attachment 251499 [details] [review]
themedicon: correctly fallback to symbolic icons

When an icon is requested as symbolic, our generic fallback algorithm
uses fullcolor icons when the specified icon name is not found, treating
the "-symbolic" suffix as another component of the icon name.

Change the algorithm to check beforehand if the icon is symbolic, remove
the suffix if so, and re-add it at the end for all the generated icon
names.
Comment 7 Cosimo Cecchi 2013-08-13 13:46:23 UTC
These two patches implement a better fallback algorithm in case the requested icon name is symbolic. We need to do this both in GThemedIcon and in GtkIconTheme itself.

Tested with Nautilus/gvfs git master.
Comment 8 Matthias Clasen 2013-08-13 15:05:03 UTC
Review of attachment 251498 [details] [review]:

I guess we could consider to fall back even further, like this:

foo-bar-symbolic -> foo-symbolic -> foo-bar -> foo

Otherwise, we could really just turn symbolic icons into a separate icon theme.

Anyway, looks fine to commit if you replace that one unnecessary printf with a concat

::: gtk/gtkicontheme.c
@@ +1876,3 @@
+          names = g_new (gchar *, dashes + 2);
+          for (i = 0; nonsymbolic_names[i] != NULL; i++)
+            names[i] = g_strdup_printf ("%s-symbolic", nonsymbolic_names[i]);

g_strconcat is sufficient here
Comment 9 Matthias Clasen 2013-08-13 15:06:41 UTC
Review of attachment 251499 [details] [review]:

'Argh' for having this code twice. Anyway, looks ok to me with the one change below

::: gio/gthemedicon.c
@@ +191,3 @@
+          themed->names = g_new (char *, dashes + 1 + 1);
+          for (i = 0; names[i] != NULL; i++)
+            themed->names[i] = g_strdup_printf ("%s-symbolic", names[i]);

Same comment: just use g_strconcat here
Comment 10 Cosimo Cecchi 2013-08-13 15:23:54 UTC
Comment on attachment 251499 [details] [review]
themedicon: correctly fallback to symbolic icons

Attachment 251499 [details] pushed as a5fd296 - themedicon: correctly fallback to symbolic icons
Comment 11 Cosimo Cecchi 2013-08-13 15:25:39 UTC
Attachment 251498 [details] pushed as b528440 - icontheme: correctly fallback to symbolic icons

I chose not to do the double fallback at the end, as it shouldn't be necessary now with the fallback working properly - and it's bad to get a fullcolor icon in an application when a symbolic is expected.

Pushed these to master with the suggested changes, thanks for the review.
Comment 12 Wolfgang Ulbrich 2013-10-28 15:06:34 UTC
Dear gnome devs,
It would be very nice and fair if you add the double fallback to normal icons.
Because this change affected other desktops too.
Currently only the cinnamon desktop enviroment is affected, but in near future also the MATE Desktop and sometime also XFCE.
And don't forget if users using gnome applications outside from gnome-shell those applications have missing icons if gnonome-icon-theme isn't installed.
I know you don't really care about other desktops and this is your good right, but if there is no technical reason for not to that, why not add fallback to normal icons if symbolic icons aren't available?
See also http://jjacky.com/2013-10-08-fixing-the-gnome-3.10-upgrade/

That would be a very noble gesture

Thanks in advance
Wolfgang Ulbrich, MATE development team
Comment 13 Matthias Clasen 2013-10-28 20:28:01 UTC
this should all be fixed in master and 3.10 - if there is any remaining problem, I'd love to hear details.
Comment 14 Wolfgang Ulbrich 2013-10-28 22:25:28 UTC
Thanks for your attention, but i realised that i've posted in the wrong report for my concerns. It is more related to the gtk dialog.
https://git.gnome.org/browse/gtk+/commit/?id=594b7520809c973eacba2370e8e79ff4fdce060a
https://bugzilla.gnome.org/show_bug.cgi?id=680048
Sorry for this noise here, this has nothing to do with gnome-icon-theme.
I will post there my concerns with examples.