awesome

Welcome to awesome bug tracking system.
Tasklist

FS#516 - Colorful background behind awesome's "a" menu

Attached to Project: awesome
Opened by Nelson A. de Oliveira (naoliv) - Monday, 04 May 2009, 12:45 GMT
Last edited by Uli Schlachter (psychon) - Monday, 27 September 2010, 09:15 GMT
Task Type Bug Report
Category Lua libraries → beautiful
Status Closed
Assigned To No-one
Operating System All
Severity Very Low
Priority Normal
Reported Version git/3.2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

(version is Debian's 3.3-rc1)

Using awesome's default config file and theme I see a colorful background behind awesome's "a" while clicking on the menu.
See the attached file.
This task depends upon

Closed by  Uli Schlachter (psychon)
Monday, 27 September 2010, 09:15 GMT
Reason for closing:  Fixed
Additional comments about closing:  commit dd656f514a12311dafcd7d464ae37545aba0c369
Author: Roman Kosenko <madkite@gmail.com>
Date: Sat Sep 18 23:08:20 2010 +0300

Fix image cropping/enlarging

Function imlib_create_cropped_image() from imlib2 doesn't initialize
buffer for new image, so if we use crop bounds bigger than original ones
we need to erase garbage from derived image.
This bug produced colorful pressed buttons ( FS#516 ,  FS#822 ) .

Signed-off-by: Roman Kosenko <madkite@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Comment by Nelson A. de Oliveira (naoliv) - Monday, 04 May 2009, 12:46 GMT
The screenshot
Comment by Julien Danjou (jd) - Monday, 04 May 2009, 12:49 GMT
Yes, this is garbage from memory. I know that, but never found how to fix it properly actually. :)
Comment by Uli Schlachter (psychon) - Friday, 11 December 2009, 16:24 GMT
Does this still happen? Don't call me on it, but I think I fixed a bug somewhere where awesome would do weird stuff with a pixmap or something like that...
Comment by Nelson A. de Oliveira (naoliv) - Friday, 11 December 2009, 22:55 GMT
It's still present on awesome 3.4.2
Comment by Uli Schlachter (psychon) - Saturday, 12 December 2009, 12:47 GMT
Ok, after some (not funny) debugging I got a patch for something different and I think this is imlib's fault.

awful.widget.button creates the image like this:
img_press = img_release:crop(-2, -2, img_release.width, img_release.height)

This causes imlib_create_cropped_image() to be called. This function allocates a buffer for the new image but doesn't actually initialize it (why should it? It's going to be filled with the cropped content anyway).
But since we are cropping from some negative offset, some later functions skips the first two rows and lines of the image and leaves them unitialized.

I managed to make valgrind complain about this by using :save() on the cropped image (no idea why the normal painting doesnt cause a warning and the warning I get this way doesn't look completely right either).

We could perhaps work around this by doing the cropping "by hand" with imlib_image_copy_rect(). (I heard that imlib's upstream is quite dead these days, is that correct?)
Comment by Julien Danjou (jd) - Saturday, 12 December 2009, 16:04 GMT
Imlib2 still gets security fixes upstream, so it's not that dead.
Comment by Uli Schlachter (psychon) - Monday, 14 December 2009, 18:58 GMT
I took this upstream and it seems like we are abusing the API[1].
Once I find the time I'll write some patches for checking the arguments to crop() and fixing awful.widget.button to use sth else for creating its image.

Uli

[1] http://trac.enlightenment.org/e/ticket/477
Comment by Uli Schlachter (psychon) - Friday, 18 December 2009, 18:31 GMT
I tried to write a patch for this, but I failed badly. :(
Anyone else wants to give this a try?
Comment by Uli Schlachter (psychon) - Saturday, 12 June 2010, 19:38 GMT
We could fill those uninitialized lines with the current theme's bg color or sth like that... Not nice, but I don't have any better idea on this.
Comment by Uli Schlachter (psychon) - Saturday, 18 September 2010, 07:40 GMT
There was just a duplicate of this ( FS#822 ) with a suggested patch.

This is NOT my patch:

Comment by Roman Kosenko (kite) - Sat Sep 18 03:15:23 2010 — Edit — Delete
suggested patch
Comment by Roman Kosenko (kite) - Saturday, 18 September 2010, 21:27 GMT
New version of patch.
Comment by anrxc (anrxc) - Monday, 27 September 2010, 13:38 GMT
Great work guys.

Loading...