diff -r 9a9a761f03f1 -r 0ed94ceaa377 widgets/widgetapp/src/WidgetUiWindowManager.cpp --- a/widgets/widgetapp/src/WidgetUiWindowManager.cpp Tue Nov 24 09:02:20 2009 +0200 +++ b/widgets/widgetapp/src/WidgetUiWindowManager.cpp Thu Dec 17 09:20:16 2009 +0200 @@ -25,23 +25,23 @@ #include "WidgetInstallerInternalCRKeys.h" #include "SWInstWidgetUid.h" #include "widgetappdefs.rh" -#include "Browser_platform_variant.hrh" +#include "browser_platform_variant.hrh" #ifdef BRDO_WRT_HS_FF #include "cpspublisher.h" #endif #include -#include -#include +#include +#include #include #include #include -#include +#include #include #include #include "cpglobals.h" // CPS string definitions. -#include +#include #include #include #include @@ -343,34 +343,40 @@ { iNetworkMode = EOnlineMode; CWidgetUiWindow* wdgt_window( GetWindow( aUid ) ); -#ifdef BRDO_WRT_HS_FF - if ( wdgt_window->NetworkModeWait()->IsStarted() ) + if (wdgt_window) { - wdgt_window->NetworkModeWait()->AsyncStop(); +#ifdef BRDO_WRT_HS_FF + if ( wdgt_window->NetworkModeWait()->IsStarted() ) + { + wdgt_window->NetworkModeWait()->AsyncStop(); + } +#endif + wdgt_window->DetermineNetworkState(); } -#endif - wdgt_window->DetermineNetworkState(); } break; case WidgetOffline: { iNetworkMode = EOfflineMode; CWidgetUiWindow* wdgt_window( GetWindow( aUid ) ); + if (wdgt_window) + { #ifdef BRDO_WRT_HS_FF - if ( wdgt_window->NetworkModeWait()->IsStarted() ) - { - wdgt_window->NetworkModeWait()->AsyncStop(); - } + if ( wdgt_window->NetworkModeWait()->IsStarted() ) + { + wdgt_window->NetworkModeWait()->AsyncStop(); + } #endif - // if no full view widgets open, then close the network connection - if ( ( !FullViewWidgetsOpen() ) && ( iConnection->Connected() ) ) - { - wdgt_window->Engine()->HandleCommandL( - (TInt)TBrCtlDefs::ECommandIdBase + - (TInt)TBrCtlDefs::ECommandDisconnect ); - iConnection->StopConnectionL(); + // if no full view widgets open, then close the network connection + if ( ( !FullViewWidgetsOpen() ) && ( iConnection->Connected() ) ) + { + wdgt_window->Engine()->HandleCommandL( + (TInt)TBrCtlDefs::ECommandIdBase + + (TInt)TBrCtlDefs::ECommandDisconnect ); + iConnection->StopConnectionL(); + } + wdgt_window->DetermineNetworkState(); } - wdgt_window->DetermineNetworkState(); } break; case WidgetRestart: @@ -997,6 +1003,9 @@ #ifdef BRDO_WRT_HS_FF wdgt_window->Engine()->MakeVisible( EFalse ); wdgt_window->Engine()->SetRect( iCpsPublisher->BitmapSize()); + //When HS comes to foreground show the latest updatd content on HS. + //Relayout can sometimes happen only when widget in FullView. + wdgt_window->PublishSnapShot(); #endif } } @@ -1397,6 +1406,11 @@ else { NotifyCommandHandled(); + TBool lastOne( iWidgetUiWindowManager->WindowListCount() == 0 ); + if( lastOne ) + { + iWidgetUiWindowManager->AppUi().Exit(); + } iWidgetUiWindowManager->SendAppToBackground(); iWidgetUiWindowManager->WidgetUIClientSession().SetActive( iUid, EFalse ); }