uiacceltk/hitchcock/goommonitor/src/goomwindowgrouplist.cpp
branchRCL_3
changeset 17 c9d868f1e20c
parent 13 3a60ebea00d0
child 18 1801340c26a2
equal deleted inserted replaced
15:cd0ae4656946 17:c9d868f1e20c
    40 CGOomWindowGroupList::TGOomWindowGroupProperties::TGOomWindowGroupProperties() :  iIdleTickTime(0), iDynamicPriority(EGOomPriorityNormal)
    40 CGOomWindowGroupList::TGOomWindowGroupProperties::TGOomWindowGroupProperties() :  iIdleTickTime(0), iDynamicPriority(EGOomPriorityNormal)
    41     {
    41     {
    42     FUNC_LOG;
    42     FUNC_LOG;
    43     }
    43     }
    44 
    44 
       
    45 void CGOomWindowGroupList::GetListOfWindowGroupsWSurfaces(RArray<TInt>& aLowOnMemWgs)
       
    46     {
       
    47     if (!iAlfClient.Handle())
       
    48        {
       
    49        if(iAlfClient.Connect() != KErrNone)
       
    50            return;
       
    51        }
       
    52     
       
    53     iAlfClient.GetListOfWindowGroupsWSurfaces(&aLowOnMemWgs);
       
    54     }
       
    55    
       
    56 
    45 // Update the list of window groups
    57 // Update the list of window groups
    46 void CGOomWindowGroupList::Refresh(TBool aOptionalOnly)
    58 void CGOomWindowGroupList::Refresh(TBool aOptionalOnly)
    47     {
    59     {
    48     FUNC_LOG;
    60     FUNC_LOG;
    49     
    61     
    70   
    82   
    71     if (!iAlfClient.Handle())
    83     if (!iAlfClient.Handle())
    72         {
    84         {
    73         User::LeaveIfError(iAlfClient.Connect());
    85         User::LeaveIfError(iAlfClient.Connect());
    74         }
    86         }
    75     iLowOnMemWgs.Reset();
    87     //iLowOnMemWgs.Reset();
    76     RArray<TInt> inactiveSurfaces;
    88     RArray<TInt> inactiveSurfaces;
    77 
    89 
    78     // ignore possible errors, we have information from profiling extension anyway
    90     // ignore possible errors, we have information from profiling extension anyway
    79     if (!aOptionalOnly)
    91     if (!aOptionalOnly)
    80         {
    92         {
    81         iAlfClient.GetListOfInactiveWindowGroupsWSurfaces(&inactiveSurfaces);    
    93         iAlfClient.GetListOfInactiveWindowGroupsWSurfaces(&inactiveSurfaces);    
    82         iAlfClient.GetListOfWindowGroupsWSurfaces(&iLowOnMemWgs);
    94         //iAlfClient.GetListOfWindowGroupsWSurfaces(&iLowOnMemWgs);
    83         }
    95         }
    84     else
    96     else
    85         { // first iteration: try to cope with window group ID's only
    97         { // first iteration: try to cope with window group ID's only
    86           // Most likely that needs to be revisited because apps fail to name their window 
    98           // Most likely that needs to be revisited because apps fail to name their window 
    87           // groups properly on external screens...  
    99           // groups properly on external screens...  
   217                 if(secureId == 0x10003B20) // magic, wserv 
   229                 if(secureId == 0x10003B20) // magic, wserv 
   218                     {
   230                     {
   219                     processIds.Close();
   231                     processIds.Close();
   220                     privMemUsed.Close();
   232                     privMemUsed.Close();
   221                     TRACES("Only WServ using GFX mem, no need for app actions");
   233                     TRACES("Only WServ using GFX mem, no need for app actions");
       
   234                     iWgIds.Reset();
   222                     return;
   235                     return;
   223                     }
   236                     }
   224                 }
   237                 }
   225             }
   238             }
   226         }
   239         }
   231     iWgIds.ReserveL(numGroups);
   244     iWgIds.ReserveL(numGroups);
   232     User::LeaveIfError(iWs.WindowGroupList(&iWgIds));
   245     User::LeaveIfError(iWs.WindowGroupList(&iWgIds));
   233     
   246     
   234     // Remove all child window groups, promote parents to foremost child position
   247     // Remove all child window groups, promote parents to foremost child position
   235     CollapseWindowGroupTree(inactiveSurfaces);
   248     CollapseWindowGroupTree(inactiveSurfaces);
   236     
   249 /*    
   237 #ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
   250 #ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
   238     TWsEvent event;
   251     TWsEvent event;
   239     event.SetType(KGoomMemoryLowEvent); // naive
   252     event.SetType(KGoomMemoryLowEvent); // naive
   240 
   253 
   241     for (TInt i = iLowOnMemWgs.Count()-1; i>=0; i--)
   254     for (TInt i = iLowOnMemWgs.Count()-1; i>=0; i--)
   242         {
   255         {
   243         iWs.SendEventToWindowGroup(iLowOnMemWgs[i], event);
   256         iWs.SendEventToWindowGroup(iLowOnMemWgs[i], event);
   244         }
   257         }
   245         
   258         
   246 #endif    
   259 #endif    
   247     
   260 */    
   248     // Note the current foreground window ID (if there is one)
   261     // Note the current foreground window ID (if there is one)
   249     TBool oldForegroundWindowExists = EFalse;
   262     TBool oldForegroundWindowExists = EFalse;
   250 
   263 
   251     TInt oldForegroundWindowId;
   264     TInt oldForegroundWindowId;
   252     if (iWgIds.Count() > 0)
   265     if (iWgIds.Count() > 0)