diff -r 9674c1a575e9 -r b8fae6b8a148 idlehomescreen/widgetmanager/src/wmplugin.cpp --- a/idlehomescreen/widgetmanager/src/wmplugin.cpp Mon Mar 15 12:39:47 2010 +0200 +++ b/idlehomescreen/widgetmanager/src/wmplugin.cpp Wed Mar 31 21:17:19 2010 +0300 @@ -86,7 +86,8 @@ void CWmPlugin::ConstructL() { iWmMainContainer = NULL; - + iPostponedCommand = ENone; + // store static view app ui CEikonEnv* eikonEnv = CEikonEnv::Static(); if ( !eikonEnv ) User::Leave( KErrUnknown ); @@ -164,11 +165,12 @@ if ( iViewAppUi->GetActiveViewId( activeViewId ) == KErrNone && activeViewId.iViewUid == TUid::Uid( EWmMainContainerViewId ) ) { - if ( iPreviousViewUid.iViewUid == KNullUid ) + if ( iPreviousViewUid.iViewUid == KNullUid && + iViewAppUi->GetDefaultViewId( iPreviousViewUid ) != KErrNone ) { iPreviousViewUid.iAppUid = iViewAppUi->Application()->AppDllUid(); iPreviousViewUid.iViewUid = TUid::Uid( 1 ); - } + } return ETrue; } @@ -184,12 +186,16 @@ if ( IsActive() ) { iWmMainContainer->SetClosingDown( ETrue ); - TRAP_IGNORE( + TRAPD( err, iEffectManager->BeginFullscreenEffectL( KAppExitEffectStyle ); iViewAppUi->ActivateLocalViewL( iPreviousViewUid.iViewUid ); ); + if ( KErrNone != err ) + { + iWmMainContainer->SetClosingDown( EFalse ); + } } } @@ -198,12 +204,11 @@ // --------------------------------------------------------- // void CWmPlugin::MainViewActivated( - const TVwsViewId& aViewId, + const TVwsViewId& /*aViewId*/, CWmMainContainer* aWmMainContainer ) { - iPreviousViewUid = aViewId; - // verify if we have correct viewid to activate. - if ( iPreviousViewUid.iViewUid == KNullUid ) + // previous view for Wm is always default view. + if ( iViewAppUi->GetDefaultViewId( iPreviousViewUid ) != KErrNone ) { // use default if we got wrong viewid as previous view iPreviousViewUid.iAppUid = iViewAppUi->Application()->AppDllUid(); @@ -234,7 +239,13 @@ iEffectManager->UiRendered(); } - TRAP_IGNORE( ExecuteCommandL(); ); + TRAPD( err, ExecuteCommandL(); ); + if ( KErrNone != err ) + { + delete iPostponedContent; + iPostponedContent = NULL; + iPostponedCommand = ENone; + } } // ---------------------------------------------------------