Alex Hudson

Thoughts on Technology, Product, & Strategy

A couple of words on Clutter…

For various reasons, I’ve been playing with Clutter over the past week. Rather than the 1.0 release that was announced a little while ago, I’m still on 0.8 – for a number of reasons, but mainly because 1.0 isn’t really available in any distro yet, and because the various language bindings are not yet up to date. LWN has a pretty decent write-up of the 1.0 release (subscriber only for the next week).

Let me talk about the negative things about Clutter first. Here are my main problems with it:

  • documentation for the bindings isn’t great. I haven’t looked at the C++ stuff, which I have a suspicion might be good, but information for pyclutter and Clutter# is extremely hard to find. For the project I’m doing, I’ve ended up writing it in C – I would have much preferred to use C#, Python or Perl in preference. Ho hum.
  • it’s not great on non-accelerated hardware. No, scratch that – it’s terrible. My machine has a decent Radeon, but because I’m using the free software driver I don’t get 3D. Clutter therefore sucks big-time. For the project I’m working on, this showed up quite early on: I couldn’t get animations to work. I would run the animation, but nothing would happen. Turned out that because I had something else going on, it wasn’t getting enough screen update time and was basically just freezing rather than dropping frame rate. I’ve changed things around to deal with this, but you absolutely need 3D acceleration for Clutter.

However, all that said, I’m extremely impressed by Clutter. The API is pretty simple: I haven’t coded using it before, and I think I learned it in about four hours. Obviously, you need to have some kind of understanding of what a scene graph is, and some of Clutter’s terminology is confusing – for me, Alpha was the worst as every time I saw it crop up I assumed it was something to do with opacity. A better name would have been ValueTimeRelationship or something – it’s just a function which computes a value between 0 and 1 given a time parameter t.

What I really like is ClutterScript – again, awful name, because it’s not a script in the programmatic sense – the ability to define parts of the user interface in an external JSON file, bring it in and play with it. It’s quite basic (there are lots of things that I’d like to do that you just can’t do, although some of it is hackable) but a big timesaver, especially in C.

It does seem to me that Clutter and Gtk need to get it together somehow. I suppose if they continue to work together relatively well it’s not too much of an issue, but I think the Clutter bits really ought to be built into the toolkit, or the other way around: there are still substantial gaps between the tool (like accessibility, as mentioned in the LWN article). But it has intrigued me about GNOME 3. I’ve seen gnome-shell and bits of Mutter, but I can see how this could be extremely compelling.

I just wonder how it’s going to work with my video card.


Compiling Bongo


Patent infringement to be criminalised?


  1. Red Hat currently employs two people on Radeon hardware enablement, and there are others in the community, so I’m hopeful you’ll have a better out of the box 3D experience in the future.

    As far as accessing Clutter from script, you might give introspection and gjs or seed (i.e. JavaScript) a try. I know documentation is sparse for them as well, but they do have the redeeming value of generally being instantly up to date with the latest Clutter because of the way gobject-introspection is building directly from the library.

    As for Clutter and Gtk, I have discovered an elegant solution but this blog comment box is too small to contain it.

  2. Alex

    Funnily enough, I’m planning on looking at Seed for other reasons anyway 🙂 Thanks for mentioning it.

    The Radeon thing is partially my own fault; I did the testing day for F11 and reported my bugs, but got off the Rawhide express when F11 came out (radeonhd was working for me) and have let the bugs slide. I’m going to try to pick up the reins again when the first alpha live disk is out.

Leave a Reply