
The title says it all, 0.6.0 is here, at last !
The official announcement is available in Compiz Fusion Community list archives.
Congratulations to the development team, translators, and support team for this awesome release ! We made it big

The title says it all, 0.6.0 is here, at last !
The official announcement is available in Compiz Fusion Community list archives.
Congratulations to the development team, translators, and support team for this awesome release ! We made it big
xkcd rocks.

A few days ago, David (Compiz main developer) pushed out a bunch of code changing radically the way actions (keyboard shortcuts, mouse actions, hot corners, visual bells) are handled by Compiz. Before these changes, every action had components for the 4 types of actions, while now there’s a specific type for each of these.
Consequently, libcompizconfig and its friends had to be updated. Patrick “marex” Niklaus, CCSM’s maintainer, being busy for a few weeks, I updated the compizconfig-python bindings and CCSM. These changes gave us the chance to review the actions handling in CCSM and change it.
Actions are no grouped in a single tab, ordered in a treeview, but they can be grouped in tabs and subgrouped in expanders as other settings. A small icon in front of actions’ label indicate the type of the action, and custom widgets were developed, among which a screen edge selector, a keyboard modifiers selector and a key grabber (which is able to grab Tab keys and such).
All graphics are courtesy of the GNOME project, thanks guys for the great work !.
Read more for some screenshots.
Gitweb web frontend for git is great, but it’s a bit slow. Lars Hjemli wrote a new web frontend a few months ago, resulting in a nice C CGI app : cgit. It supports page caching, direct source tarball download, repositories grouping, graphical diffstats, pretty urls…
You can now use our very own cgit at http://cgit.opencompositing.org/, please report any bug on Freenode IRC/#compiz-fusion-dev or on bugzilla
Thanks to krh and daniels, who set it up on Freedesktop, we even have pretty urls!
Here’s the rewrite rule for lighttpd :
^/([^?]*)(?:\?(.*))?$” => “/cgit.cgi?url=$1&$2″
By the way, I guess I’ll setup a gitstat as soon as it supports multiple repositories/trees. It just looks too great.
Worse and worse… 12 days and no news. I hate holidays, heh. Nevertheless, I have written more than 2500 lines during these 12 days. Let’s have a quick overview over all this code
What’s new?
Two Compiz plugins!
The first one is something that I missed from Beryl, bottom cube caps. The new “cubecaps” plugin supports top and bottom caps, correctly blends caps color with the images (e.g. if you select a black cap color, the result won’t be completely black whatever the image is as with the previous “cube” plugin caps, but will be your image on a black background), and supports caps when there are more than 4 viewports (actually one could also enable them for 3 viewports by changing a single integer in the source file (currently at line 288 of cubecaps.c at commit 6d463e3), but it might look wrong if image is too big). Finally, clamping is done using clamp_to_border extension if available, which avoids weird lines when using non scaled images with alpha.
I’ll add some screenshots when I’ll be able to upload them… I am currently using my cellphone to post this, sadly.
The second one is a lot more specific : it displays some visual feedback of what you are doing with your mouse and your keyboards. More specifically, when you hit one of your mouse buttons it displays (when enabled) a little mouse in the bottom right of the screen with the button you hit highlighted, until you release it. Likewise, when you press a modifier key (Alt, Shift…) it displays a nice rounded rectangle in which the name of the modifier is written in the bottom left corner of the screen. It’s pretty hard to describe how it actually looks with words, but I hope you get it anyway. The main use case if for showing used key bindings when demonstrating/teaching the usage of an application.
Again, screenshots will come
I began working on a third plugin that would handle metacity -> Compiz -> metacity switch and move windows from the workspace they were on to the corresponding viewport upon startup and do the opposite upon shutdown, but there’s another core problem that blocks it (plugins are initialized after screen and windows were initialized, during which windows are all moved to current workspace).
I also happened to need a quick way to test some Cairo drawing before using it for the final application (which could, for instance, require compiling before testing, which is kinda annoying when you are trying to find right values for a simple drawing). I wrote a “cairoDrawingArea” PyGTK widget which handles the drawing of a Cairo surface (plus a patterned background and/or borders). One just has to write a child of this function and write the draw () method to do the actual Cairo drawing. I included the whole thing at the end of this post. I know I could/should have just used the write_to_png function on the Cairo surface, but dealing with nautilus/eog is just so unhumane and slow, while I needed (again) a fast way to view the result of my changes.
Most of the code for this script comes from a quick PyGTK Tic Tac Toe game I wrote to show a friend how one could write a fully working “software” in less than 2 hours. By the way, I am wondering if it would be possible to write an AI that would have no clue on the rules of a simple game such as Tic Tac Toe, and learn them round after round.

Last but not least, I fixed some bugs and mem leaks in my colorfilter plugin and cleaned the code a lot. There is now only one remaining thing to do for this plugin before it gets considered as done : fragment program parameters. Shouldn’t be too hard, but I am not sure of the way to cumulate filters using parameters (maybe it is just impossible).
What’s wrong?
I definitely can’t fix Filters Manager problems :/ I tried writing the base rgb -> hsv -> rgb fragment program using Cg, but it resulted in a 120 lines long fragment program, while poor Intel 900 GMA chipsets only support 96. Pretty sad, heh. The other problems (randomly borked cumulative filters preview and a strange OpenGL Invalid Operation error on first action on one of the previews when they are both displayed) are still there as well, but I think I could probably workaround them by having just one OpenGL drawing area which would process a queue of drawing operations
What’s next?
I’m quite unsure… I’d like to finish my Summer of Code, but it’s sadly held by the Filters Manager problems and by some bugs in Compiz Core that won’t be fixed before next release (which should hopefully happen pretty soon… I guess I’ll have to wear back my release roller hat for Fusion). I have done a lot of Compiz coding (some patches which I discussed with David and finally got a wider solution, fixing numerous other problems, some other patches that might make it after next release, and the two plugins), and I currently don’t have much ideas on what I could do (even though I would be very happy to find a good reason to learn more about OpenGL
). I have some mathematics related things planned as well (involving convex hulls, hypercubes and such), and some web coding which is becoming really high priority. Getting CamlUI ready for Windows and fixing the handling of toplevels must also be done (I would like to write a similar gedit plugin, if I can find some time to do so). And I do need to finish cairo-swissknife. So much things to do and so little time
Off topic.
I am looking for a real touch screen bigger than 10″. I would really really like to try to code some touch screen specific apps, but all I found was either fake touchscreens or unavailable laptops (which would actually be better than a simple touchscreen, I don’t really care about money as long as it’s less than 2000€). Hints welcome
This afternoon, while making some posters for the French Free Software World Meetings (RMLL), I was willing to get a high resolution PNG version of the Compiz SVG logo. I fired up Inkscape, created a landscape A3 document loaded the original logo file, scaled it and ran the export tool to get a 300 dpi A3 PNG. 20 minutes later it was still running… While it was still running I took my laptop and wrote a quick script using python cairo and librsvg bindings. 5 minutes later (yeah, reading documentations/googling for examples takes a while), I ran it and got my high resolution PNG. I cleaned it up this evening, here is the end result script =)
Usage : svntopng [--width WIDTH] [--height HEIGHT] [-o OUTPUTFILE] SOURCEFILE
#!/usr/bin/python '''svgtopng - SVG to PNG converter Copyright (c) 2007 Guillaume Seguin <guillaume@segu.in> Licensed under GNU GPLv2''' import cairo import rsvg from sys import argv from os.path import exists import getopt def usage (): print "Usage : %s [--width WIDTH] [--height HEIGHT] [-o OUTPUTFILE] FILE" % argv[0] raise SystemExit if __name__ == "__main__": try: opts, args = getopt.getopt (argv[1:], 'o:h', ['width=', 'height=', 'output=', 'help']) except getopt.GetoptError: usage () output = None width = None height = None for o, a in opts: if o in ('-o', '--output'): output = str (a) elif o == '--width': width = int (a) elif o == '--height': height = int (a) elif o in ('-h', '--help'): usage () if len (args) == 0: usage () file = args[0] if not exists (file): usage () svg = rsvg.Handle (file = file) if not output: if file[-4:] == ".svg": file = file[:-4] output = "%s.png" % file base = "%s%d.png" i = 1 while exists (output): output = base % (file, i) i += 1 if width == 0 and height == 0: width = svg.props.width height = svg.props.width elif width != 0: ratio = float (width) / svg.props.width height = int (ratio * svg.props.height) elif height != 0: ratio = float (height) / svg.props.height width = int (ratio * svg.props.width) surface = cairo.ImageSurface (cairo.FORMAT_ARGB32, width, height) cr = cairo.Context (surface) wscale = float (width) / svg.props.width hscale = float (height) / svg.props.height cr.scale (wscale, hscale) svg.render_cairo (cr) surface.write_to_png (output)
My libcompizconfig patch to enable software to create an empty context and load a custom set of plugins afterwars has just been accepted =) The compizconfig-python bindings were updated as well!
Here is an updated “plugin reloader” script :
#!/usr/bin/env python '''Compiz plugin reloader (through compizconfig) Copyright (c) 2007 Guillaume Seguin <guillaume@segu.in> Licensed under GNU GPLv2''' import compizconfig from sys import argv, exit from time import sleep if __name__ == "__main__": if len (argv) < 2: print "Usage : %s plugin1 [plugin2 ... pluginN]" % argv[0] exit (2) plugins = argv[1:] context = compizconfig.Context (plugins = plugins) print "Unloading " + " ".join (plugins) for plugin in plugins: if plugin not in context.Plugins: print "Warning : %s plugin not found" % plugin plugins.remove (plugin) continue context.Plugins[plugin].Enabled = False if len (plugins) == 0: print "Error : no plugin found" exit (1) context.Write () print "Waiting before reloading" sleep (2) print "Loading " + " ".join (plugins) for plugin in plugins: context.Plugins[plugin].Enabled = True context.Write ()
We are now reaching the half of this Summer of Code, and it is about time to review what has been done so far.
One of the things that are particularly boring when working on a Compiz plugin is that you have to reload it all the time, and there is no quick way to do it (I usually unload/reload it through ccsm, which involves some mouse deplacement and needs a ccsm window, or or I just reload compiz, which takes quite a bit of time).
Consequently I thought I could write a little script that would reload one or more plugins for me quickly. It took less than 5 minutes with the neat libcompizconfig python bindings, and works pretty well as far as I can see. (so yes, it depends on libcompizconfig, but heh, that’s worth it)
Here is the code :
#!/usr/bin/env python '''Compiz plugin reloader (through compizconfig) Copyright (c) 2007 Guillaume Seguin <guillaume@segu.in> Licensed under GNU GPLv2''' import compizconfig from sys import argv, exit from time import sleep if __name__ == "__main__": if len (argv) < 2: print "Usage : %s plugin1 [plugin2 ... pluginN]" % argv[0] exit (2) plugins = argv[1:] context = compizconfig.Context (basic_metadata = True) print "Unloading " + " ".join (plugins) for plugin in plugins: if plugin not in context.Plugins: print "Warning : %s plugin not found" % plugin plugins.remove (plugin) continue context.Plugins[plugin].Enabled = False if len (plugins) == 0: print "Error : no plugin found" exit (1) context.Write () print "Waiting for settings update" sleep (2) print "Loading " + " ".join (plugins) for plugin in plugins: context.Plugins[plugin].Enabled = True context.Write ()