Fix for bug 2114 - Podcatcher wont close from the "open apps" menu
authorteknolog
Sat, 03 Apr 2010 13:33:15 +0100
changeset 104 4d1286f7f982
parent 103 520291e28460
child 105 236022094302
Fix for bug 2114 - Podcatcher wont close from the "open apps" menu
application/group/Podcast.mmp
application/src/PodcastAppui.cpp
--- a/application/group/Podcast.mmp	Sat Apr 03 12:02:32 2010 +0100
+++ b/application/group/Podcast.mmp	Sat Apr 03 13:33:15 2010 +0100
@@ -114,4 +114,5 @@
 LIBRARY ws32.lib 
 LIBRARY hlplch.lib
 LIBRARY bitgdi.lib 
+LIBRARY apgrfx.lib 
 
--- a/application/src/PodcastAppui.cpp	Sat Apr 03 12:02:32 2010 +0100
+++ b/application/src/PodcastAppui.cpp	Sat Apr 03 13:33:15 2010 +0100
@@ -29,7 +29,7 @@
 #include "debug.h"
 #include "..\help\podcatcher.hlp.hrh"
 #include "PodcastApp.h"
-
+#include <APGWGNAM.H>
 #include <HLPLCH.H>
 #include <avkon.hrh>
 
@@ -127,9 +127,30 @@
             }
         case EEikCmdExit:
         	{
-			TApaTask task(iEikonEnv->WsSession());
-			task.SetWgId(iEikonEnv->RootWin().Identifier());
-			task.SendToBackground(); 
+        	// we want to prevent red button from closing podcatcher, and
+        	// instead we send it to background
+        	// however, we want to respect the task manager (fast swap) close
+        	// command, so we check if task manager is the focussed window group
+        	
+        	RWsSession& ws = iEikonEnv->WsSession();
+			TInt wgid = ws.GetFocusWindowGroup();
+			CApaWindowGroupName* gn = CApaWindowGroupName::NewLC(ws, wgid);
+			TUid activeAppUid = gn->AppUid();
+			CleanupStack::PopAndDestroy(gn);
+        	
+			const TUid KUidFastSwap = { 0x10207218 };
+			if (activeAppUid == KUidFastSwap)
+				{
+				// closed by task manager
+				Exit();
+				}
+			else
+        		{
+        		// red button pressed
+				TApaTask task(iEikonEnv->WsSession());
+				task.SetWgId(iEikonEnv->RootWin().Identifier());
+				task.SendToBackground(); 
+        		}   		
 			break;
         	}
 	case EPodcastHelp: