From 7f669912bbcc24034bbcaa8df8dd833491315706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Thu, 8 May 2008 09:22:24 +0000 Subject: [PATCH] Fix initialization with non-truecolor depths. svn path=/trunk/KDE/kdebase/workspace/; revision=805344 --- scene_xrender.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/scene_xrender.cpp b/scene_xrender.cpp index ccadcc2028..6c9614708b 100644 --- a/scene_xrender.cpp +++ b/scene_xrender.cpp @@ -97,17 +97,28 @@ SceneXrender::SceneXrender( Workspace* ws ) return; } KXErrorHandler xerr; - // create XRender picture for the root window - format = XRenderFindVisualFormat( display(), DefaultVisual( display(), DefaultScreen( display()))); - if( format == NULL ) - return; // error if( wspace->createOverlay()) { 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 ); } 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; pa.subwindow_mode = IncludeInferiors; front = XRenderCreatePicture( display(), rootWindow(), format, CPSubwindowMode, &pa );