From 2fb2f761688f2241677aa09ce4f1b30ca96035eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Fri, 8 Feb 2008 10:31:40 +0000 Subject: [PATCH] Reshuffle compositing init a bit, and make KWIN_COMPOSE work even if compositing is turned off in options. svn path=/trunk/KDE/kdebase/workspace/; revision=772299 --- composite.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/composite.cpp b/composite.cpp index 95992e6542..ed88cae258 100644 --- a/composite.cpp +++ b/composite.cpp @@ -77,7 +77,9 @@ namespace KWin void Workspace::setupCompositing() { #ifdef KWIN_HAVE_COMPOSITING - if( !options->useCompositing ) + if( scene != NULL ) + return; + if( !options->useCompositing && getenv( "KWIN_COMPOSE") == NULL ) { kDebug( 1212 ) << "Compositing is turned off in options"; return; @@ -87,14 +89,6 @@ void Workspace::setupCompositing() kError( 1212 ) << "Compositing is not possible"; return; } - if( scene != NULL ) - return; - char selection_name[ 100 ]; - sprintf( selection_name, "_NET_WM_CM_S%d", DefaultScreen( display())); - cm_selection = new KSelectionOwner( selection_name ); - connect( cm_selection, SIGNAL( lostOwnership()), SLOT( lostCMSelection())); - cm_selection->claim( true ); // force claiming - CompositingType type = options->compositingMode; if( getenv( "KWIN_COMPOSE" )) { @@ -109,11 +103,16 @@ void Workspace::setupCompositing() break; default: kDebug( 1212 ) << "No compositing"; - delete cm_selection; return; } } + char selection_name[ 100 ]; + sprintf( selection_name, "_NET_WM_CM_S%d", DefaultScreen( display())); + cm_selection = new KSelectionOwner( selection_name ); + connect( cm_selection, SIGNAL( lostOwnership()), SLOT( lostCMSelection())); + cm_selection->claim( true ); // force claiming + switch( type ) { /*case 'B':