Fix last commit.

svn path=/trunk/KDE/kdebase/workspace/; revision=827111
This commit is contained in:
Luboš Luňák 2008-07-02 10:11:16 +00:00
parent 075dda2993
commit 5d0f9b66dd

View file

@ -478,24 +478,19 @@ Pixmap Toplevel::createWindowPixmap()
assert( compositing()); assert( compositing());
grabXServer(); grabXServer();
KXErrorHandler err; KXErrorHandler err;
Pixmap pix = XCompositeNameWindowPixmap( display(), frameId()); window_pix = XCompositeNameWindowPixmap( display(), frameId());
// check that the received pixmap is valid and actually matches what we // check that the received pixmap is valid and actually matches what we
// know about the window (i.e. size) // know about the window (i.e. size)
XWindowAttributes attrs; XWindowAttributes attrs;
if( !XGetWindowAttributes( display(), frameId(), &attrs )) if( !XGetWindowAttributes( display(), frameId(), &attrs )
window_pix = None; || err.error( false )
if( err.error( false )) || attrs.width != width() || attrs.height != height() || attrs.map_state != IsViewable )
window_pix = None;
if( attrs.width != width() || attrs.height != height() || attrs.map_state != IsViewable )
window_pix = None;
ungrabXServer();
if( window_pix == None || pix == None )
{ {
kDebug( 1212 ) << "Creating window pixmap failed: " << this; kDebug( 1212 ) << "Creating window pixmap failed: " << this;
if( pix != None ) XFreePixmap( display(), window_pix );
XFreePixmap( display(), pix ); window_pix = None;
} }
window_pix = pix; ungrabXServer();
return window_pix; return window_pix;
#else #else
return None; return None;