Re: Foobar patch



George <jirka 5z com> writes:
> 
> You're leaking the pixmap if you scale down.  The ref behaviour is all
> stupid there and the wnck_foo_foo_get_mini_icon function doesn't ref the
> pixbuf, and so I made the internal default getting function also not ref it,
> but it's just strange api I think.  Something like pixbufs as return values
> should either be 'const' or reffed.  Havoc?
> 

It's totally standard that returned objects are neither const nor
reffed. Look at almost any example in GTK, except the broken ones.

libwnck actually has a function to set the size of mini icon or icon
you get. The only problem with that is that with shared lib applets,
they will break each other if they ask for different sizes. So the
current API is broken since the required icon size is a global
variable, basically.

Still it's best to have libwnck do the scaling so we scale from the
original icon, not from an icon that's already been scaled once by
libwnck. If we scale twice it'll look unecessarily crappy.

So I think there should maybe be create_mini_icon_at_size() and
create_icon_at_size() functions that do return a ref'd object and
maybe create it if required. To make this efficient should probably
cache the original natural-size icon in the WnckIconCache.

Havoc



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