Fix initialization with non-truecolor depths.
svn path=/trunk/KDE/kdebase/workspace/; revision=805344
This commit is contained in:
parent
33fc8c024f
commit
7f669912bb
1 changed files with 15 additions and 4 deletions
|
@ -97,17 +97,28 @@ SceneXrender::SceneXrender( Workspace* ws )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
KXErrorHandler xerr;
|
KXErrorHandler xerr;
|
||||||
// create XRender picture for the root window
|
|
||||||
format = XRenderFindVisualFormat( display(), DefaultVisual( display(), DefaultScreen( display())));
|
|
||||||
if( format == NULL )
|
|
||||||
return; // error
|
|
||||||
if( wspace->createOverlay())
|
if( wspace->createOverlay())
|
||||||
{
|
{
|
||||||
wspace->setupOverlay( None );
|
wspace->setupOverlay( None );
|
||||||
|
XWindowAttributes attrs;
|
||||||
|
XGetWindowAttributes( display(), wspace->overlayWindow(), &attrs );
|
||||||
|
format = XRenderFindVisualFormat( display(), attrs.visual );
|
||||||
|
if( format == NULL )
|
||||||
|
{
|
||||||
|
kError( 1212 ) << "Failed to find XRender format for overlay window";
|
||||||
|
return;
|
||||||
|
}
|
||||||
front = XRenderCreatePicture( display(), wspace->overlayWindow(), format, 0, NULL );
|
front = XRenderCreatePicture( display(), wspace->overlayWindow(), format, 0, NULL );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// create XRender picture for the root window
|
||||||
|
format = XRenderFindVisualFormat( display(), DefaultVisual( display(), DefaultScreen( display())));
|
||||||
|
if( format == NULL )
|
||||||
|
{
|
||||||
|
kError( 1212 ) << "Failed to find XRender format for root window";
|
||||||
|
return; // error
|
||||||
|
}
|
||||||
XRenderPictureAttributes pa;
|
XRenderPictureAttributes pa;
|
||||||
pa.subwindow_mode = IncludeInferiors;
|
pa.subwindow_mode = IncludeInferiors;
|
||||||
front = XRenderCreatePicture( display(), rootWindow(), format, CPSubwindowMode, &pa );
|
front = XRenderCreatePicture( display(), rootWindow(), format, CPSubwindowMode, &pa );
|
||||||
|
|
Loading…
Reference in a new issue