Stjepan Glavina
2007-Jan-26 00:14 UTC
[compiz] Get window textures even when they're transformed.
If I wobble a window and quickly initiate switcher or cube, this can
cause weird artifacts.
I had a look at Beryl's switcher.c
In switchPaintThumb they use this:
static void
switchPaintThumb(...)
{
DrawWindowGeometryProc oldDrawWindowGeometry;
AddWindowGeometryProc oldAddWindowGeometry;
WindowPaintAttrib sAttrib = *attrib;
int wx, wy;
float width, height;
CompIcon *icon = NULL;
/* Wrap drawWindowGeometry to make sure the general
drawWindowGeometry function is used */
oldDrawWindowGeometry = w->screen->drawWindowGeometry;
w->screen->drawWindowGeometry = getBaseDrawWindowGeometry();
oldAddWindowGeometry = w->screen->addWindowGeometry;
w->screen->addWindowGeometry = getBaseAddWindowGeometry();
...... calulating and painting .......
w->screen->drawWindowGeometry = oldDrawWindowGeometry;
w->screen->addWindowGeometry = oldAddWindowGeometry;
}
Why Compiz's switcher.c doesn't use this?
Stjepan
Mike Dransfield
2007-Jan-26 08:01 UTC
[compiz] Get window textures even when they're transformed.
> Why Compiz's switcher.c doesn't use this? > >The only difference is that in Beryl they also switch the addWindowGeometry function. The rest of it is in Compiz, but I can see the corruption goes if you switch addWindowGeometry as well.
David Reveman
2007-Jan-26 15:27 UTC
[compiz] Get window textures even when they're transformed.
On Fri, 2007-01-26 at 09:14 +0100, Stjepan Glavina wrote:> If I wobble a window and quickly initiate switcher or cube, this can > cause weird artifacts. > > I had a look at Beryl's switcher.c > In switchPaintThumb they use this: > > static void > switchPaintThumb(...) > { > DrawWindowGeometryProc oldDrawWindowGeometry; > AddWindowGeometryProc oldAddWindowGeometry; > WindowPaintAttrib sAttrib = *attrib; > int wx, wy; > float width, height; > CompIcon *icon = NULL; > > /* Wrap drawWindowGeometry to make sure the general > drawWindowGeometry function is used */ > > oldDrawWindowGeometry = w->screen->drawWindowGeometry; > w->screen->drawWindowGeometry = getBaseDrawWindowGeometry(); > oldAddWindowGeometry = w->screen->addWindowGeometry; > w->screen->addWindowGeometry = getBaseAddWindowGeometry(); > > ...... calulating and painting ....... > > w->screen->drawWindowGeometry = oldDrawWindowGeometry; > w->screen->addWindowGeometry = oldAddWindowGeometry; > } > > Why Compiz's switcher.c doesn't use this? >Yes, I guess that's a bug. However, saving addWindowGeometry function pointers like that is just a temporary solution that will go away soon. I've pushed out some changes that makes it work OK for now.. - David