Re: Nm-applet crashes with assertion `dest_width > 0' failed

On Wed, 2012-04-25 at 09:53 +0100, Michal Kawalec wrote:
> Hello,
> I wonder if you know the solution to the following bug:
> To sum up, when system tray is smaller than 18px the icon is not shown
> at all and nm-applet displays "'dest_width > 0' failed " error message.

This assertion comes from GdkPixbuf (as you've found) as a result of a
call from gtk_status_icon_update_image() which is called from
gtk_status_icon_set_from_pixbuf().  We tried really, really hard to
ensure that nm-applet doesn't pass an invalid pixbuf to GTK, so I have
to conclude that this bug is in GTK in this block of code in

	    size = priv->size;

	    width  = gdk_pixbuf_get_width  (pixbuf);
	    height = gdk_pixbuf_get_height (pixbuf);

	    if (width > size || height > size)
	      scaled = gdk_pixbuf_scale_simple (pixbuf,
						MIN (size, width),
						MIN (size, height),

nm-applet will never pass in a pixbuf that's less than 16px square.
That leaves only the GtkStatusIcon's priv->size being 0, which would be
a bug in GTK as far as I can tell...  that could be caused either by
internal GTK size-allocation process issues or even the amount of space
that the DE gives the status icon.  So AFAICT nm-applet is doing what it
can, while GTK should probably be doing a bit more to ensure it doesn't
call GDK with invalid arguments.

I've added some code to print out the size allocation the applet gets if
you run it like so:

killall -TERM nm-applet
NMA_SIZE_DEBUG=1 nm-applet

which might help narrow things down if you're able to rebuild the applet
from git locally.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]