taskswitcher/contextengine/tsfswserver/engine/src/tsfswengine.cpp
branchRCL_3
changeset 47 7be2816dbabd
parent 38 79311d856354
child 50 137ebc85284b
--- a/taskswitcher/contextengine/tsfswserver/engine/src/tsfswengine.cpp	Tue Apr 27 16:26:12 2010 +0300
+++ b/taskswitcher/contextengine/tsfswserver/engine/src/tsfswengine.cpp	Tue May 11 16:02:39 2010 +0300
@@ -40,9 +40,6 @@
 // for screenshots, they are scaled down to (screensize/this_factor).
 const TInt KScreenSizeFactor = 2;
 
-// format to get a lowercase hex string prefixed with 0x
-_LIT( KHexFmt, "0x%x" );
-
 const TUid KTsCameraUid = { 0x101F857a };
 
 //close command for widget
@@ -318,7 +315,7 @@
     if ( iFgAppUid != newUid && newUid.iUid )
         {
         iFgAppUid = newUid;
-        iFgAppUidStr.Format( KHexFmt, iFgAppUid.iUid );
+        iDataList->MoveEntryAtStart(newUid.iUid, EFalse);
         }
 
     TSLOG_OUT();
@@ -482,7 +479,12 @@
     TSLOG2_IN( "aWgId = %d aFbsHandle = %d", aWgId, aFbsHandle );
 
     TUid appUid;
-    TInt err = iDataList->AppUidForWgId( aWgId, appUid );
+    TInt wgId = iDataList->FindMostTopParentWgId(aWgId);
+    if ( wgId == KErrNotFound )
+        {
+        wgId = aWgId;
+        }
+    TInt err = iDataList->AppUidForWgId( wgId, appUid );
     if ( err || appUid == KTsCameraUid )
         {
         // Dont't assign screenshot to camera app
@@ -497,7 +499,6 @@
     iPreviewProvider->AckPreview(aFbsHandle);
     if ( err == KErrNone )
         {
-		iDataList->MoveEntryAtStart(appUid.iUid, EFalse);
         StoreScreenshot(aWgId, bmp);
         }