Reset 'buffer' to None after freeing it.

That fixes the bug that XRender compositing can't be initialized
correctly on KDE startup.

svn path=/trunk/KDE/kdebase/workspace/; revision=821854
This commit is contained in:
Tobias Koenig 2008-06-18 16:41:26 +00:00
parent b703dc91a5
commit 69d45962cb

View file

@ -139,6 +139,7 @@ SceneXrender::~SceneXrender()
}
XRenderFreePicture( display(), front );
XRenderFreePicture( display(), buffer );
buffer = None;
wspace->destroyOverlay();
foreach( Window* w, windows )
delete w;
@ -153,8 +154,6 @@ bool SceneXrender::initFailed() const
// so it is done manually using this buffer,
void SceneXrender::createBuffer()
{
if( buffer != None )
XRenderFreePicture( display(), buffer );
Pixmap pixmap = XCreatePixmap( display(), rootWindow(), displayWidth(), displayHeight(), DefaultDepth( display(), DefaultScreen( display())));
buffer = XRenderCreatePicture( display(), pixmap, format, 0, 0 );
XFreePixmap( display(), pixmap ); // The picture owns the pixmap now