--- a/taskswitcher/taskswitcherui/taskswitcherapp/src/tsappui.cpp Wed Sep 01 12:32:46 2010 +0100
+++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tsappui.cpp Tue Sep 14 20:58:58 2010 +0300
@@ -155,6 +155,7 @@
iApplicationTask.SetWgId( iWg.Identifier() );
// And finally, go to background.
+ iForeground = ETrue;
MoveAppToBackground( ENoneTransition );
iEikonEnv->RootWin().SetOrdinalPosition(-1, ECoeWinPriorityNeverAtFront);
@@ -167,11 +168,6 @@
iUiStarted = EFalse;
iDisableAppKeyHandling = EFalse;
- // Set process priority to high to avoid being
- // locked by heavy ui apps processing
- iEikonEnv->WsSession().ComputeMode(RWsSession::EPriorityControlDisabled);
- RProcess().SetPriority(EPriorityHigh);
-
iForegroundDelayed = EFalse;
iDelayedForegroundInProgress = EFalse;
@@ -183,7 +179,7 @@
// Perform the first phase of two phase construction
// -----------------------------------------------------------------------------
//
-CTsAppUi::CTsAppUi(): iForeground( ETrue ),
+CTsAppUi::CTsAppUi(): iForeground( EFalse ),
iApplicationTask( iCoeEnv->WsSession() )
{
// no implementation required
@@ -196,7 +192,7 @@
//
CTsAppUi::~CTsAppUi()
{
- if( GfxTransEffect::IsRegistered( iAppView ) )
+ if( iAppView && GfxTransEffect::IsRegistered( iAppView ) )
{
GfxTransEffect::Deregister(iAppView);
@@ -270,6 +266,7 @@
TUint aSubCom )
{
const TDesC8* ptr = reinterpret_cast<const TDesC8*>(iAppView);
+ GfxTransEffect::AbortFullScreen();
GfxTransEffect::Abort(iAppView);
GfxTransEffect::Begin( iAppView, aTranstionId );
GfxTransEffect::SetDemarcation( iAppView, iAppView->Rect() );
@@ -301,6 +298,7 @@
{
// App start animation
const TDesC8* ptr = reinterpret_cast<const TDesC8*>(iAppView);
+ GfxTransEffect::AbortFullScreen();
GfxTransEffect::Abort(iAppView);
TInt groupId = GfxTransEffect::BeginGroup();
GfxTransEffect::BeginFullScreen(
@@ -538,6 +536,8 @@
//
TInt CTsAppUi::GoToBackgroundTimerCallback( TAny* aParam )
{
+ TSLOG_STATIC_CONTEXT( GoToBackgroundTimerCallback, TSLOG_LOCAL, RThread().Id() );
+ TSLOG_IN();
CTsAppUi* self = static_cast<CTsAppUi*>( aParam );
if ( self->iGoToBackgroundTimer )
{
@@ -550,7 +550,7 @@
// Notify
self->HandleSwitchToBackgroundEvent();
-
+ TSLOG_OUT();
return 0;
}
@@ -584,6 +584,10 @@
TSLOG_CONTEXT( MoveAppToForeground, TSLOG_LOCAL );
TSLOG_IN();
+ if ( !iUiStarted )
+ {
+ TRAP_IGNORE( iUnderAppWgId = WgIdOfUnderlyingAppL(EFalse) );
+ }
iUiStarted = ETrue;
// Request window server to bring our application
@@ -626,7 +630,8 @@
{
iForeground = EFalse;
SetTaskswitcherStateProperty( KTaskswitcherBackgroundValue );
-
+
+ iAppView->MakeVisible( EFalse );
// notify view
iAppView->HandleSwitchToBackgroundEvent();
@@ -743,7 +748,6 @@
{
SetOrientationL(EAppUiOrientationPortrait);
}
- RProcess().SetPriority(EPriorityForeground);
SetFullScreenApp(EFalse);
iEikonEnv->RootWin().SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront);
}
@@ -765,7 +769,6 @@
iEikonEnv->RootWin().SetOrdinalPosition(-1, ECoeWinPriorityNeverAtFront);
SetOrientationL(EAppUiOrientationAutomatic);
SetFullScreenApp(EFalse);
- RProcess().SetPriority(EPriorityHigh);
}
TSLOG_OUT();
}
@@ -802,12 +805,16 @@
void CTsAppUi::HandleWsEventL(const TWsEvent& aEvent,
CCoeControl* aDestination)
{
+ TSLOG_CONTEXT( CTsAppUi::HandleWsEventL, TSLOG_LOCAL );
CAknAppUi::HandleWsEventL(aEvent, aDestination);
TInt eventType = aEvent.Type();
if ( eventType == EEventWindowGroupListChanged )
{
TInt wgId = WgIdOfUnderlyingAppL(EFalse);
+ TSLOG2( TSLOG_INFO, "WgIdOfUnderlyingAppL: %d appId: %d",
+ wgId, GetAppIdL( wgId ).iUid );
if ( iForeground &&
+ wgId &&
wgId != iUnderAppWgId &&
!iAppView->AppCloseInProgress(iUnderAppWgId) &&
!iAppView->WgOnTaskList(wgId) )
@@ -820,6 +827,7 @@
}
iUnderAppWgId = wgId;
}
+ TSLOG_OUT();
}
@@ -829,12 +837,19 @@
//
TInt CTsAppUi::WgIdOfUnderlyingAppL( TBool aIgnoreParentChild )
{
+ TSLOG_CONTEXT( CTsAppUi::WgIdOfUnderlyingAppL, TSLOG_LOCAL );
TInt retVal(0);
TInt underlyingWg = CheckForUnderlyingHiddenAppsL();
if ( !underlyingWg )
{
- TApaTaskList taskList( iEikonEnv->WsSession() );
+ TApaTaskList taskList(iEikonEnv->WsSession());
underlyingWg = taskList.FindByPos(0).WgId();
+ if ( !(GetAppIdL(underlyingWg).iUid) )
+ {
+ TSLOG1 (TSLOG_INFO, "Incorrect underlying window group: %d.", underlyingWg );
+ TSLOG0 (TSLOG_INFO, "No association to appId, nor special handling for underlying hidden apps.Change return value into 0.");
+ underlyingWg = 0;
+ }
}
if ( aIgnoreParentChild )
@@ -846,6 +861,7 @@
TInt parentWg = GetTopParentWg( underlyingWg );
retVal = parentWg ? parentWg : underlyingWg;
}
+ TSLOG_OUT();
return retVal;
}
@@ -916,10 +932,7 @@
TInt underlyingWg(allWgIds[0].iId);
CleanupStack::PopAndDestroy(&allWgIds);
- CApaWindowGroupName* windowName =
- CApaWindowGroupName::NewLC( iEikonEnv->WsSession(), underlyingWg );
- TUid appUid = windowName->AppUid();
- CleanupStack::PopAndDestroy( windowName );
+ TUid appUid = GetAppIdL( underlyingWg );
if( appUid == KTsCameraUid ||
appUid == KTsTelephoneUid )
{
@@ -939,10 +952,7 @@
TApaTaskList taskList( iEikonEnv->WsSession() );
TInt underlyingWg = taskList.FindByPos(0).WgId();
- CApaWindowGroupName* windowName =
- CApaWindowGroupName::NewLC( iEikonEnv->WsSession(), underlyingWg );
- TUid appUid = windowName->AppUid();
- CleanupStack::PopAndDestroy( windowName );
+ TUid appUid = GetAppIdL( underlyingWg );
if ( appUid == KTsCameraUid )
{
retVal = ETrue;
@@ -961,4 +971,18 @@
return iDelayedForegroundInProgress;
}
+// -----------------------------------------------------------------------------
+// CTsAppUi::GetAppIdL
+// -----------------------------------------------------------------------------
+//
+TUid CTsAppUi::GetAppIdL( TInt aWgId )
+ {
+ TUid retVal;
+ CApaWindowGroupName* windowName =
+ CApaWindowGroupName::NewLC( iEikonEnv->WsSession(), aWgId );
+ retVal = windowName->AppUid();
+ CleanupStack::PopAndDestroy( windowName );
+ return retVal;
+ }
+
// End of file