! 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 !
Panel launchers have missing icons after 4.4.x to 4.6.0
Status:
RESOLVED: FIXED
Product:
Xfce4-panel
Component:
Launcher

Comments

Description Robby Workman editbugs 2009-03-08 18:52:16 CET
At first, I thought this was an issue related to the fact that Rodent is gone in 4.6.0, and maybe the user-specific config still had references to the Rodent theme.  kelnos cooked up a patch to the migration script that checked for this and changed it to Tango or Gnome or whatever else happened to be on the system, but the missing icons are still present after the upgrade.

I've got a virtual machine snapshotted with xfce-4.4.x and a config with a few custom launcher icons, and after playing around a bit, I think I see the problem (or at least part of it):

  (after upgrade to 4.6.0, but before starting it): 
  root@pkgdev:~/.config/xfce4/panel# grep Icon *
  launcher-10.rc:X-XFCE-IconCategory=7
  launcher-12363047061.rc:X-XFCE-IconCategory=5
  (and several more of those, depending on how many panel icons are present)

I'm guessing that those "X-XFCE-IconCategory" numbers map to an actual 
icon in the 4.4.x icon theme, so if the migration script could translate 
that "7" to "icon-name-whatever" and sed s/X-XFCE-IconCategory=/Icon=/g 
on all the launcher-*.rc files, then I think all would be good.

This would *have* to be done on first launch of xfce-4.6, and there's no 
way to retroactively fix them for users who have already started 4.6 and 
logged off; the entire X-XFCE-IconCategory line is deleted on session 
logout.

  (after logging off):
  root@pkgdev:~/.config/xfce4/panel# grep Icon *
  root@pkgdev:~/.config/xfce4/panel#
Comment 1 Robby Workman editbugs 2009-03-11 13:51:09 CET
Okay, one of our users (thanks, titopoquito!) was less lazy than me and found that icons.{h,c} in libxfcegui4 defines those.  After investigating which icon names are found in which themes, I believe the following is what you'll want:

 0      xfce-unknown
 1      accessories-text-editor
 2      system-file-manager
 3      xfce-utils
 4      applications-games
 5      help-browser
 6      applications-multimedia
 7      applications-internet
 8      applications-graphics
 9      printer
10      xfce-schedule
11      applications-office
12      xfce-sound
13      utilities-terminal
14      applications-development
15      preferences-desktop
16      applications-system
17      xfce-wine
18      applications-accessories

With one exception, all of these icons are found in both the Tango and Gnome themes (or are installed to hicolor by xfce itself).  The exception is xfce-wine, which didn't have an icon in 4.4.x either, so there's no regression with it anyway.  The only icon theme I see that has a wine icon is kde's oxygen, and I strongly suspect that it's GPLv3, so xfce can't borrow it.
Comment 2 Brian J. Tarricone (not reading bugmail) 2009-03-11 19:46:15 CET
For the remaining 'xfce-' prefixed icons, are there any icon-naming-spec-compliant names we can use instead?  (Preferably names that are in Tango and g-i-t.)
Comment 3 Robby Workman editbugs 2009-03-12 02:43:31 CET
Okay, titopoquito chipped in again after following up on the bug report, and based on his feedback, here's a revised list that should work:

 0      applications-other
 1      accessories-text-editor
 2      system-file-manager
 3      applications-accessories
 4      applications-games
 5      help-browser
 6      applications-multimedia
 7      applications-internet
 8      applications-graphics
 9      printer
10      xfce-schedule   *** SEE BELOW ***
11      applications-office
12      audio-card
13      utilities-terminal
14      applications-development
15      preferences-desktop
16      applications-system
17      xfce-wine   *** SEE BELOW ***
18      applications-accessories

Re xfce-schedule, I'm not sure.  That icon is an hourglass, implying that it might have been related to scheduling or timekeeping.  If that's the case, then perhaps "office-calendar" is best, but titopoquito recommended using "applications-office."  Whatever you guys think is best, I suppose.

Since there is no wine icon, I'd probably go with "applications-other" for it too.
Comment 4 Robby Workman editbugs 2009-03-14 20:45:55 CET
Created attachment 2234 
Shell script to fix icon names in launcher files

Attached shell script seems to work here ; all icons are present after upgrade.
Comment 5 Brian J. Tarricone (not reading bugmail) 2009-03-14 22:49:10 CET
Cool.  Too bad this will have to be converted to perl to go in the migration script :-P
Comment 6 Brian J. Tarricone (not reading bugmail) 2009-03-14 23:33:42 CET
Nick, this needs to be migrated in the launcher plugin itself.  I went and wrote a sub for the migration script to do this, but then I realised that we can't guarantee that the migration script will run before the panel starts (in fact, I can almost guarantee it *won't* run before the panel starts), and in that case, the only way to make the changes is to do "pkill -9 xfce4-panel" in the migration script after making the changes.

So the launcher plugin needs to look for X-XFCE-Icon-Category when it loads the launcher config and should convert the number into the icon-naming-spec name from the list that Robby provided, and then write out a new launcher config with the correct Icon=.
Comment 7 Brian J. Tarricone (not reading bugmail) 2009-03-14 23:49:36 CET
Created attachment 2236 
migrate config in launcher plugin

This might work... untested.
Comment 8 Robby Workman editbugs 2009-03-15 00:00:40 CET
Tested. It works!  Thanks, Brian!
Comment 9 Nick Schermer editbugs 2009-03-15 11:35:30 CET
Thanks for the patch Brian. Committed in revision 29666.

Bug #5067

Reported by:
Robby Workman
Reported on: 2009-03-08
Last modified on: 2009-03-15

People

Assignee:
Nick Schermer
CC List:
2 users

Version

Attachments

Shell script to fix icon names in launcher files (1.75 KB, text/plain)
2009-03-14 20:45 CET , Robby Workman
no flags
migrate config in launcher plugin (1.91 KB, patch)
2009-03-14 23:49 CET , Brian J. Tarricone (not reading bugmail)
no flags

Additional information