Possible bug in Composite extension
Amir Bukhari
ufz6 at rz.uni-karlsruhe.de
Wed Jan 5 03:48:05 PST 2005
In LG3D project we have notice that when we resize some application
their content are not fully updated and we see garbage content instead.
after debuging LG3D and Xorg I have found the following in Composite
extension:
1- when resize occure it create a new pixmap and copy bits pixel from
parent window to new pixmap to have reasonable background.
2- after resize operation is done the old pixmap is destroyed.
normal application will receive Exposure event to update their content,
but not all application repaint the complet window from scratch after
each resize, they expect that some parts of the window are not affected
by resizing and thus don't repaint this parts. this case has not been
taken by composite extension.
I have made a modification to compReallocPixmap, so that it copy
reasonable pixel from the old pixmap to new pixmap.
bellow you will find my modificaton. if you have any inputs please don't
wait to give it us here ;-).
the big fix:
if (pix_w != pOld->drawable.width || pix_h != pOld->drawable.height)
{
pNew = compNewPixmap (pWin, pix_x, pix_y, pix_w, pix_h);
if (!pNew)
return FALSE;
cw->pOldPixmap = pOld;
compSetPixmap (pWin, pNew);
#ifdef LG3D
int height = pix_h < pOld->drawable.height ?
pix_h:pOld->drawable.height;
int width = pix_w < pOld->drawable.width ? pix_w:pOld->drawable.width;
GCPtr pGC = GetScratchGC (pWin->drawable.depth, pScreen);
/*
* Copy bits from the old pixmap into the new pixmap so that it will
* have "reasonable" contents in case the application doesn't update
the content
* after resize occure. this happend when the window is in the top
stack and thus
* application doesn't need to repaint its complete content
(background, menus etc).
* example applications is gnome-calculator & xterm.
*/
if (pGC)
{
XID val = IncludeInferiors;
ValidateGC(&pNew->drawable, pGC);
dixChangeGC (serverClient, pGC, GCSubwindowMode, &val, NULL);
(*pGC->ops->CopyArea) (&pOld->drawable,
&pNew->drawable,
pGC,
0, 0,
width, height, 0, 0);
FreeScratchGC (pGC);
}
#endif
}
More information about the xorg
mailing list