awesome

Welcome to awesome bug tracking system.
Tasklist

FS#1019 - awful.menu breaks if an image is unreadable

Attached to Project: awesome
Opened by Julien Danjou (jd) - Thursday, 05 July 2012, 15:19 GMT
Last edited by Uli Schlachter (psychon) - Saturday, 03 November 2012, 19:09 GMT
Task Type Bug Report
Category Core
Status Closed
Assigned To No-one
Operating System All
Severity Low
Priority Normal
Reported Version 3.4.12
Due in Version 3.5
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

When building a menu with a SVG file that Imlib2 can't read, this is what happens:

W: awesome: image_new_from_file:288: cannot load image /usr/share/icons/hicolor/scalable/apps/monodevelop.svg: unknown error, that's really bad
W: awesome: luaA_dofunction:108: error while running function
stack traceback:
/usr/share/awesome/lib/awful/menu.lua:221: in function 'add_item'
/usr/share/awesome/lib/awful/menu.lua:438: in function 'new'
/usr/share/awesome/lib/awful/menu.lua:115: in function 'exec'
/usr/share/awesome/lib/awful/menu.lua:152: in function 'item_enter'
/usr/share/awesome/lib/awful/menu.lua:239: in function </usr/share/awesome/lib/awful/menu.lua:239>
error: /usr/share/awesome/lib/awful/menu.lua:221: attempt to compare number with nil

And that breaks the whole menu, which is a shame. It should cope with such an error I think.

See http://bugs.debian.org/680390
This task depends upon

Closed by  Uli Schlachter (psychon)
Saturday, 03 November 2012, 19:09 GMT
Reason for closing:  Fixed
Additional comments about closing:  Oh, I just noticed that is already fixed in git/master:

commit ea40a922edaa7f2b50501a16462f30407eeef8d4
Author: dodo <dodo@blacksec.org>
Date: Wed Mar 30 23:11:41 2011 +0200

awful.menu: rewrite


This commit skips all menu items which fail to be created (and prints an error message about this)
Comment by Uli Schlachter (psychon) - Thursday, 05 July 2012, 20:16 GMT
Someone who can test 3.4 stuff could check how much the attached patch helps.
Comment by Uli Schlachter (psychon) - Thursday, 05 July 2012, 20:16 GMT
*cough* ...the attached patch helps
Comment by Akira (Osleg) - Thursday, 12 July 2012, 14:10 GMT
I'm sorry but... where is attached patch?
ty
Comment by Uli Schlachter (psychon) - Thursday, 12 July 2012, 14:37 GMT
Oh... Flyspray got to be kidding me.

The idea was to load the image in a pcall(). In 3.4, this would be the call to image() that would need to be wrapped. For git/master, that's surface.load(). Any takers?
Comment by Uli Schlachter (psychon) - Tuesday, 16 October 2012, 18:24 GMT
Now that  FS#1028  is fixes, I wonder if this should be left unfixed. After all, SVGs now work and the remaining errors are, well, errors...
Not erroring out on them might hide errors.

Loading...