[FusionDev] Freewins + 3D windows with depth
Maxim Levitsky
maximlevitsky at gmail.com
Mon Feb 4 02:34:37 CET 2008
Hi,
I am looking more and more to start compiz hacking.
To say the truth, the compiz code is quite hard to understand, but
I like both the compiz and the way it was coded very much.
Everything in C, and the chain linking of plug-ins is great.
(Obivosly I am speaking about both compiz, and compiz-fusion)
Yesterday, I took seriously a challenge to fix freewins plugin to work together
with the 3D plugin.
Currently if a window is transformed, its border is drawn without transformation.
I found following things:
1 - 3D plugin draws the border, and then calls other plugins (including freewins)
to draw the windows. Obviously it can't know about freewins transformation.
thus I moved the freewins to be _before_ 3d.
this changed the output a bit, now one side of the window is drawn correctly
(transformed by freewins), but the other side isn't transformed.
the border now is transformed, and it fills the gap between those windows.
2- tracking this down, I found why this happens, but I don't know how to fix this
correctly (without ugly workarounds):
a) 3d hooks into cube plugin, and this alows it to draw all the windows on the cube sides.
this happens in tdPostPaintViewport()
b) 3d plugin need to paint two copies of each window, and each copy has a bit different
transformation matrix, but the PaintWindow takes just one matrix, thus there is a bit ugly workaround:
it saves second matrix in global variable, and used in it tdPaintWindow to draw the border, and second window.
The problem here is that this matrix isn't transformed by freewins, and like I said this is exacly what I see on screen.
What can you suggest here?
It is possible to create a ugly workaround, by making freewins check for 3d, and translate this second matrix.
It is possible to "beatify" this thing, by creating a formal hook in 3d, like 3dTransformOutput.
Or maybe it is better to fix it in core by introducing some sort of general per window transform?
Or maybe something like that already exist, but I don't know about it (please tell me if this is true)
Or maybe generate the second matrix from the first (I don't think this is easy, since it is already transformed)
Besides this I noticed another bug, but I think it is easier to fix:
the 3d windows are drawn over the cube:
I mean if I disable cube caps, enable transparency of cube, rotate it, and look from above I see windows
on top of cube sides.
Best regards,
Maxim Levitsky
More information about the Dev
mailing list