Create a new window for each tested pixmap with selfcheck, otherwise

second test fails for some reason with BadAlloc in glXCreatePixmap().
Maybe nvidia bug, but could be also some hidden KWin bug (according
to GLX docs, glXCreatePixmap() can give BadAlloc only when it can't
allocate, which is nonsense here, but glXCreateWindow() says that
BadAlloc may mean calling it twice on the same window, so maybe
here it's twice with the same pixmap - I don't see where the bug
could be though).


svn path=/trunk/KDE/kdebase/workspace/; revision=857141
remotes/origin/Plasma/5.0
Luboš Luňák 18 years ago
parent 36977673b3
commit 6fd9d4e4b3
  1. 17
      scene_opengl.cpp

@ -633,16 +633,16 @@ void SceneOpenGL::selfCheckSetup( QRegion& damage )
img.setPixel( 2, 0, QColor( Qt::blue ).rgb());
img.setPixel( 3, 0, QColor( Qt::white ).rgb());
img.setPixel( 4, 0, QColor( Qt::black ).rgb());
XSetWindowAttributes wa;
wa.override_redirect = True;
::Window window = XCreateWindow( display(), rootWindow(), 0, 0, 5, 1, 0, QX11Info::appDepth(),
CopyFromParent, CopyFromParent, CWOverrideRedirect, &wa );
QPixmap pix = QPixmap::fromImage( img );
XSetWindowBackgroundPixmap( display(), window, pix.handle());
XClearWindow( display(), window );
XMapWindow( display(), window );
foreach( const QPoint& p, selfCheckPoints())
{
XSetWindowAttributes wa;
wa.override_redirect = True;
::Window window = XCreateWindow( display(), rootWindow(), 0, 0, 5, 1, 0, QX11Info::appDepth(),
CopyFromParent, CopyFromParent, CWOverrideRedirect, &wa );
XSetWindowBackgroundPixmap( display(), window, pix.handle());
XClearWindow( display(), window );
XMapWindow( display(), window );
XMoveWindow( display(), window, p.x(), p.y());
Pixmap wpix = XCompositeNameWindowPixmap( display(), window );
glXWaitX();
@ -653,10 +653,11 @@ void SceneOpenGL::selfCheckSetup( QRegion& damage )
texture.render( infiniteRegion(), rect );
Workspace::self()->addRepaint( rect );
texture.unbind();
glXWaitGL();
XFreePixmap( display(), wpix );
damage |= rect;
XDestroyWindow( display(), window );
}
XDestroyWindow( display(), window );
}
void SceneOpenGL::selfCheckFinish()

Loading…
Cancel
Save