[Xfce-bugs] [Bug 14685] Right mouse click in thunar will not display icons for custom actions only

bugzilla-daemon at xfce.org bugzilla-daemon at xfce.org
Mon Sep 17 12:28:31 CEST 2018


https://bugzilla.xfce.org/show_bug.cgi?id=14685

Jehan <jehan.marmottard at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jehan.marmottard at gmail.com

--- Comment #7 from Jehan <jehan.marmottard at gmail.com> ---
Created attachment 7980
  --> https://bugzilla.xfce.org/attachment.cgi?id=7980&action=edit
Fix icons in Thunar

There is indeed a behavior regression in g_icon_to_string() but there is also a
bug in Thunar. The upstream glib issue was only putting Thunar bug into light.

Basically you are assuming that `g_icon_to_string()` is returning an icon name:
https://git.xfce.org/xfce/thunar/tree/plugins/thunar-uca/thunar-uca-provider.c#n230

Then later you reuse this information with this assumption:
https://git.xfce.org/xfce/thunar/tree/thunar/thunar-menu-util.c?id=2708c105bee56f3920f7bd8d0578768fd384a754#n59

This is the bug here.  A GIcon can be a GFileIcon (for which g_icon_to_string()
would not return an icon name) or a themed name created with fallback icons, or
whatever other sub-type of icons which may be created in the future. You should
not assume you get an icon name.

So anyway the attached patch fixes this. I also update
`thunarx_menu_item_new()` docs to acknowledge for this. Note that it should not
break any previous uses of this API in plug-ins or whatever else, as paths and
icon names are valid textual representations which can be recreated by
g_icon_new_for_string().

Actually if anything this is fixing more bugs, as you were using
g_icon_new_for_string() which would have not worked with a path (unlike what
your docs say!). :-)

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Xfce-bugs mailing list