diff -r 0aa5fbdfbc30 -r 3d340a0166ff uifw/AvKon/src/aknApp.cpp --- a/uifw/AvKon/src/aknApp.cpp Tue Apr 27 16:55:05 2010 +0300 +++ b/uifw/AvKon/src/aknApp.cpp Tue May 11 16:27:42 2010 +0300 @@ -31,6 +31,7 @@ #include #include #include +#include LOCAL_C TBool IsInHiddenList(const TUid& aUid) { @@ -64,15 +65,40 @@ CApaWindowGroupName* wgName = CApaWindowGroupName::NewLC(ws, myWg); wgName->SetAppUid(uid); wgName->SetWindowGroupName(env->RootWin()); - - // Use a CAknTaskList to check for root instances of apps - CAknTaskList* taskList = CAknTaskList::NewLC(ws); - TBool foundInstance = EFalse; - + + // Use a CAknTaskList to check for root instances of apps + CAknTaskList* taskList = CAknTaskList::NewLC(ws); + TBool foundInstance = EFalse; + // Look for another instance of this app while (wgId>=0) { - if (wgId && wgId != myWg && taskList->IsRootWindowGroup(wgId)) + TBool rootTask = taskList->IsRootWindowGroup(wgId); + TBool rootWg = EFalse; + TInt wndPriority = -1; + if ( wgId != myWg && wgId > 0 && !rootTask ) + { + wndPriority = ws.GetWindowGroupOrdinalPriority( wgId ); + RArray wgs; + // it seems effecient to call WindowGroupList here, this codes will seldom executed. + ws.WindowGroupList( wndPriority, &wgs ); + + TInt count = wgs.Count(); + for ( TInt ii=0; ii