[compiz] g-w-d.c -> my head spins

Mike Hearn mike at plan99.net
Thu Apr 6 06:28:11 PDT 2006


Mirco Müller wrote:
> I'm currently looking like a jackass and feel just dumb for not really
> comprehending the code :/

Hardly :) The code is lacking comments, and I've had a hard time 
figuring parts out too. One thing I'd like to do at some point is go 
through one of the plugins and add some detailed comments explaining 
what each part does. The HTML tutorial is a good start but there are 
many details it misses out.

For instance it took me a little while to figure out the animation 
scheme used ... in the past when I've done animation the algorithm I 
used was something like record the start time of the animation, for each 
loop around the paint code take the current time, calculate the 
"progress" as a value between 0 and 1 then lock the animation relative 
to that. So you specify in the code how many seconds an animation should 
last for.

Compiz uses a different scheme in which the elapsed time is used to 
calculate the number of steps and each steps progress is defined as an 
option. The way the number of steps is calculated and what the 
"timestep" option does still isn't really clear to me, but when I figure 
it out I'll try documenting it for others.

Likewise the screen grab API isn't too hard to understand when you 
figure it out but IMHO it's otherwise not obvious that  "if 
(ss->grabIndex)" means "if the animation is currently in progress".

thanks -mike


More information about the compiz mailing list