! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Right mouse click in thunar will not display icons for custom actions only
Status:
RESOLVED: FIXED

Comments

Description Erik Dubois 2018-09-08 10:19:30 CEST
Created attachment 7968 
this is the right mouse click panel when on thunar

Version : 1.8.1git-f5147445
Os : Arch Linux / ArcoLinux

Only the custom actions icons will not display when clicking right mouse click on a thunar window.

Downgrading to 1.6.15-1 will make the custom actions display again.

It is not related to an icon theme. None of the icon themes will display an icon in version 1.8.1.

Again - just for the custom actions.
Comment 1 sugarmilkdawg 2018-09-09 18:17:08 CEST
Same issue. Downgrading glib2 to 2.56.2 also fixes this issue, perhaps thunar has to accommodate whatever changes were made in glib2 though.
Comment 2 Evangelos Foutras 2018-09-09 19:34:43 CEST
A fix for glib is being worked on here: https://gitlab.gnome.org/GNOME/glib/issues/1513

I have tested the proposed patch there and it fixes this issue. Once committed, it'll be added to Arch's glib2 package.
Comment 3 sugarmilkdawg 2018-09-09 19:37:27 CEST
(In reply to Evangelos Foutras from comment #2)
> A fix for glib is being worked on here:
> https://gitlab.gnome.org/GNOME/glib/issues/1513
> 
> I have tested the proposed patch there and it fixes this issue. Once
> committed, it'll be added to Arch's glib2 package.

I'll try it in a bit and report my findings. Thanks for the info!
Comment 4 Erik Dubois 2018-09-09 19:45:28 CEST
Created attachment 7971 
thunar fixed after downgrading
Comment 5 Erik Dubois 2018-09-10 07:03:35 CEST
When downgrading glib to 2.56.2-1 then the icons will show up again.

https://arcolinuxforum.com/viewtopic.php?f=80&t=816&p=3117&sid=79872256a4383a2926cd4dea45b298bc#p3117
Comment 6 Andre Miranda editbugs 2018-09-11 03:13:01 CEST
Icon names are retrieved with exo_icon_chooser_dialog_get_icon which states that "the selected icon can be either a named icon (from the active icon theme) or the absolute path to an image file in the file system".

I honestly don't know how to work this around, Thunar doesn't do anything fancy to set those icons:
https://git.xfce.org/xfce/thunar/tree/thunar/thunar-menu-util.c?id=2708c105bee56f3920f7bd8d0578768fd384a754#n59

Upstream broke stuff, so let's await their fix.
Comment 7 Jehan 2018-09-17 12:28:31 CEST
Created attachment 7980 
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!). :-)
Comment 8 Jehan 2018-09-17 12:32:24 CEST
P.S.: I have not actually tested my patch, nor have I even built it (as I don't have xfce4-dev-tools, and don't feel like spending too much time on this, sorry ;p). I think it is fine, hopefully I have not done any stupid mistake there. ;-)
Comment 9 Git Bot editbugs 2018-09-18 22:44:37 CEST
Jehan referenced this bugreport in commit 8349a54d998755f51a4e217f7adddb3445af05a8

Right mouse click will not display icons for custom actions. (Bug #14685)

https://git.xfce.org/xfce/thunar/commit?id=8349a54d998755f51a4e217f7adddb3445af05a8
Comment 10 Git Bot editbugs 2018-09-18 22:47:53 CEST
Jehan referenced this bugreport in commit 0f6cc96a1d43664325ae2133c48d5395a19bd1af

Right mouse click will not display icons for custom actions. (Bug #14685)

https://git.xfce.org/xfce/thunar/commit?id=0f6cc96a1d43664325ae2133c48d5395a19bd1af
Comment 11 alexxcons editbugs 2018-09-18 22:50:36 CEST
Thanks alot for the patch!

Looks good to me and was tested by Andre Miranda.

Just applied it to master and the 4.14 branch. Will be released in thunar 1.8.2
Comment 12 Andre Miranda editbugs 2018-09-19 15:40:15 CEST
*** Bug 14708 has been marked as a duplicate of this bug. ***

Bug #14685

Reported by:
Erik Dubois
Reported on: 2018-09-08
Last modified on: 2018-09-19
Duplicates (1):
  • 14708 No icons in Thunar custom action

People

Assignee:
Xfce Bug Triage
CC List:
8 users

Version

Attachments

this is the right mouse click panel when on thunar (46.00 KB, image/jpeg)
2018-09-08 10:19 CEST , Erik Dubois
no flags
thunar fixed after downgrading (84.11 KB, image/jpeg)
2018-09-09 19:45 CEST , Erik Dubois
no flags
Fix icons in Thunar (4.50 KB, patch)
2018-09-17 12:28 CEST , Jehan
no flags

Additional information