Skip to content
Snippets Groups Projects
Commit 8349a54d authored by Jehan's avatar Jehan Committed by Alexander Schwinn
Browse files

Right mouse click will not display icons for custom actions.

(Bug #14685)

g_icon_to_string() is not meant to return an icon name, it returns a
"textual representation of the icon", which is mostly "proprietary to
GIcon" (in GIO documentation's own words).
In particular the reverse function to get a GIcon back from this
representation is g_icon_new_for_string().

The reason why it used to work was because of a special casing (which
happens to be the most common case: when you create an icon with a
single name); yet even if the most common, relying on special cases is a
bad idea. The special case is about to be reinstated in GLib so it will
work again as expected, yet only until the next time a widget uses a not
special-cased GIcon, for instance if using fallback icons. It is better
to really fix the code.

Now the menu properly recreates the icon using g_icon_new_for_string(),
not assuming what type of icons it was (it could be an icon name, a
path, a list of icon names, or whatever else proprietary representation
any type of icon may use now or in the future).
Also update the doc of thunarx_menu_item_new() to explicitly states that
the icon parameter is a textual representation as returned by
g_icon_to_string(). In particular this won't break any plug-ins as
single icon names and icon paths are proper representations for icons
too.
parent e2d22a8c
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment