idlehomescreen/xmluirendering/uiengine/src/xnviewadapter.cpp
branchRCL_3
changeset 28 d721605b30d0
parent 26 1b758917cafc
--- a/idlehomescreen/xmluirendering/uiengine/src/xnviewadapter.cpp	Wed Jun 09 09:29:04 2010 +0300
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnviewadapter.cpp	Mon Jun 21 15:27:11 2010 +0300
@@ -322,6 +322,7 @@
 void CXnViewAdapter::PrepareToExit()
     {                
     iAppUiAdapter.RemoveFromStack( iEventDispatcher );
+    
     delete iEventDispatcher;
     iEventDispatcher = NULL;
     
@@ -388,16 +389,16 @@
 
     __TICK( "CXnViewAdapter::DoActivateL" );
     __TIME_MARK( time );
+
+    TBool wasActive( iFlags.IsSet( EIsActivated ) );
     
     iFlags.Set( EIsActivated );
     
-    // State must be cleared before adding to stack
     iEventDispatcher->ClearStateL();
+           
+    iAppUiAdapter.RemoveFromStack( iEventDispatcher );
     iAppUiAdapter.AddToStackL( *this, iEventDispatcher );
 
-    // enable statuspane transparancy 
-    CEikStatusPane* sp( iAppUiAdapter.StatusPane() );
-
     CEikButtonGroupContainer* bgc( iAppUiAdapter.Cba() );
     
     if ( bgc )
@@ -408,30 +409,37 @@
 
         iAppUiAdapter.RemoveFromStack( cba );        
         }
-        
+       
     iBgManager->MakeVisible( ETrue );
-
-    // Set status pane layout
+        
     CXnViewData& viewData( iAppUiAdapter.ViewManager().ActiveViewData() );
-    CXnProperty* prop( viewData.Node()->LayoutNode()->GetPropertyL( 
-        XnPropertyNames::view::KStatusPaneLayout ) );
-
-    // Is there status pane declaration available
-    TInt spane( DetermineStatusPaneLayout( prop ) );
-
-    if ( spane != KErrNotFound )
+    
+    if ( !wasActive )
         {
-        if ( sp && sp->CurrentLayoutResId() != spane )
+        // Set status pane layout        
+        CXnProperty* prop( viewData.Node()->LayoutNode()->GetPropertyL( 
+            XnPropertyNames::view::KStatusPaneLayout ) );
+    
+        CEikStatusPane* sp( iAppUiAdapter.StatusPane() );
+        
+        // Is there status pane declaration available
+        TInt spane( DetermineStatusPaneLayout( prop ) );
+    
+        if ( spane != KErrNotFound )
             {
-            sp->SwitchLayoutL( spane );
-            sp->ApplyCurrentSettingsL();
-            }
-        }    
-    
-    if ( sp && !sp->IsTransparent() ) 
-        { 
-        sp->EnableTransparent( ETrue );
-        sp->DrawNow();
+            if ( sp && sp->CurrentLayoutResId() != spane )
+                {
+                sp->SwitchLayoutL( spane );
+                sp->ApplyCurrentSettingsL();
+                }
+            }    
+        
+        // enable statuspane transparancy        
+        if ( sp && !sp->IsTransparent() ) 
+            { 
+            sp->EnableTransparent( ETrue );
+            sp->DrawNow();
+            }    
         }
 
     if ( aCustomMessage == KSetWallpaper )