uiacceltk/hitchcock/ServerCore/Src/alfbridge.cpp
branchRCL_3
changeset 22 7c5dd702d6d3
parent 17 3ac8bf5c5014
child 24 f93c875b566e
equal deleted inserted replaced
17:3ac8bf5c5014 22:7c5dd702d6d3
   101 //#define ALF_DEBUG_VISUALIZE_WINDOWGROUP_ORDER
   101 //#define ALF_DEBUG_VISUALIZE_WINDOWGROUP_ORDER
   102 
   102 
   103 // Timeout for manual refresh
   103 // Timeout for manual refresh
   104 const TInt KAlfManualRefreshTimeout = 35000;
   104 const TInt KAlfManualRefreshTimeout = 35000;
   105 
   105 
       
   106 _LIT_SECURITY_POLICY_PASS(KAlwaysPass);
       
   107 const TUid KPSSysCategory = { KUidSystemCategoryValue };
       
   108 const TUint32 KAlfPSKeyHSVisible = 0x2002EA91;
       
   109 
   106 const TInt KFadeAction = 6000;
   110 const TInt KFadeAction = 6000;
   107 
   111 
   108 NONSHARABLE_CLASS( TAlfBridgeDrawerWrapper ) : public MAlfDrawerScreenInterface
   112 NONSHARABLE_CLASS( TAlfBridgeDrawerWrapper ) : public MAlfDrawerScreenInterface
   109     {
   113     {
   110 public:
   114 public:
   220     iOrphanStorage->ConstructL();
   224     iOrphanStorage->ConstructL();
   221 	
   225 	
   222     RegisterFadeEffectL();
   226     RegisterFadeEffectL();
   223     
   227     
   224     iManualRefreshTimer = CPeriodic::NewL(CActive::EPriorityStandard);
   228     iManualRefreshTimer = CPeriodic::NewL(CActive::EPriorityStandard);
       
   229 
       
   230     RProperty::Define( KPSSysCategory, KAlfPSKeyHSVisible, RProperty::EInt, KAlwaysPass, KAlwaysPass );
       
   231     RProperty::Set( KPSSysCategory, KAlfPSKeyHSVisible, 0 );
       
   232     
   225     }
   233     }
   226 
   234 
   227 // ---------------------------------------------------------------------------
   235 // ---------------------------------------------------------------------------
   228 //  RegisterFadeEffectL
   236 //  RegisterFadeEffectL
   229 //
   237 //
  1383     TBool fullscreenCovered = EFalse;
  1391     TBool fullscreenCovered = EFalse;
  1384     CAlfAppSrvSessionBase* topMostAlfSrvSession = NULL;
  1392     CAlfAppSrvSessionBase* topMostAlfSrvSession = NULL;
  1385     
  1393     
  1386     iBgSurfaceFound = EFalse;
  1394     iBgSurfaceFound = EFalse;
  1387     iHomeScreenWallpaperWindowFound = EFalse;
  1395     iHomeScreenWallpaperWindowFound = EFalse;
       
  1396     iHomeScreenVisible = EFalse;
  1388    
  1397    
  1389     // Check if effect group has an effect with opaque hint.
  1398     // Check if effect group has an effect with opaque hint.
  1390     CHuiControlGroup& fxcontrolgroup = *(iAlfScreens[aScreenNumber]->iFullscreenEffectControlGroup);
  1399     CHuiControlGroup& fxcontrolgroup = *(iAlfScreens[aScreenNumber]->iFullscreenEffectControlGroup);
  1391     CHuiControl& fxcontrol = fxcontrolgroup.Control(0);
  1400     CHuiControl& fxcontrol = fxcontrolgroup.Control(0);
  1392     CHuiCanvasVisual* fxlayout = (CHuiCanvasVisual*)&fxcontrol.Visual(0);
  1401     CHuiCanvasVisual* fxlayout = (CHuiCanvasVisual*)&fxcontrol.Visual(0);
  1661                 iBridgerClient.SendBlind(EAlfQueueRequestBGSessions, TIpcArgs(KAlfCompositionTargetVisible));
  1670                 iBridgerClient.SendBlind(EAlfQueueRequestBGSessions, TIpcArgs(KAlfCompositionTargetVisible));
  1662                 iBgAnimHidden = EFalse;
  1671                 iBgAnimHidden = EFalse;
  1663                 }
  1672                 }
  1664             }
  1673             }
  1665         }
  1674         }
  1666 
  1675         
  1667     if ( iSwRenderingEnabled )
  1676     if (iHomeScreenPSValue != iHomeScreenVisible)
  1668         {
  1677         {
  1669         screen->iDisplay->SetForegroundTextureOptions( alfWindowGroupFoundVisible );
  1678         TInt value = iHomeScreenVisible;
  1670         }
  1679         if ((iHomeScreenVisible && iHomeScreenWallpaperWindowFound) || iBgAnimHidden)
       
  1680             {
       
  1681             value = EFalse;
       
  1682             }
       
  1683         if (value != iHomeScreenPSValue)
       
  1684             {
       
  1685             RProperty::Set( KPSSysCategory, KAlfPSKeyHSVisible, value );
       
  1686             iHomeScreenPSValue = value;
       
  1687             }
       
  1688         }
       
  1689 
       
  1690 	screen->iDisplay->SetForegroundTextureOptions( alfWindowGroupFoundVisible | alfClientWindowGroupVisible );
  1671 
  1691 
  1672     // Finally, if there are fadeeffects applied to windowgroups, make sure first one does not
  1692     // Finally, if there are fadeeffects applied to windowgroups, make sure first one does not
  1673     // blend itself, but other windowgroups do blend. Otherwise windowgrouops above others
  1693     // blend itself, but other windowgroups do blend. Otherwise windowgrouops above others
  1674     // would clear the screen areas where they do not really draw.
  1694     // would clear the screen areas where they do not really draw.
  1675     if (checkFadeEffectInScreen)
  1695     if (checkFadeEffectInScreen)
  1859             canvasVisual->SetCapturingBufferL(aScreen->iSwRenderingTarget);                
  1879             canvasVisual->SetCapturingBufferL(aScreen->iSwRenderingTarget);                
  1860 
  1880 
  1861             // We found an _ACTIVE_ window in homescreens controlgroup
  1881             // We found an _ACTIVE_ window in homescreens controlgroup
  1862             if (aControlGroup.SecureId() == 0x102750F0)
  1882             if (aControlGroup.SecureId() == 0x102750F0)
  1863                 {
  1883                 {
       
  1884                 iHomeScreenVisible = ETrue;
  1864                 // which is fully opaque, and visible ...
  1885                 // which is fully opaque, and visible ...
  1865                 if ( (canvasVisual->iOpacity.Now() > 0.001) && canvasVisual->Flags() & EHuiVisualFlagOpaqueHint)
  1886                 if ( (canvasVisual->iOpacity.Now() > 0.001) && canvasVisual->Flags() & EHuiVisualFlagOpaqueHint)
  1866                     {
  1887                     {
  1867                     // ... and it's a fullscreen one, and does not have a transparent clear in it
  1888                     // ... and it's a fullscreen one, and does not have a transparent clear in it
  1868                     if (canvasVisual->DisplayRect().Round() == Display(0)->VisibleArea() &&
  1889                     if (canvasVisual->DisplayRect().Round() == Display(0)->VisibleArea() &&
  2069         if (!canvasVisual->LayerExtent().IsEmpty())
  2090         if (!canvasVisual->LayerExtent().IsEmpty())
  2070             {
  2091             {
  2071             // Determine if surface is visible.
  2092             // Determine if surface is visible.
  2072             TBool surfaceWasVisible = ( canvasVisual->CanvasFlags() & EHuiCanvasFlagSurfaceVisible );
  2093             TBool surfaceWasVisible = ( canvasVisual->CanvasFlags() & EHuiCanvasFlagSurfaceVisible );
  2073             TBool surfaceWasInvisible = ( canvasVisual->CanvasFlags() & EHuiCanvasFlagSurfaceInvisible );
  2094             TBool surfaceWasInvisible = ( canvasVisual->CanvasFlags() & EHuiCanvasFlagSurfaceInvisible );
  2074             __ALFLOGSTRING2("CAlfBridge::HideTarget: %d %d", aVisible, surfaceWasVisible);
  2095             __ALFLOGSTRING2("CAlfBridge::HandleLayerVisibility aVisible %d surfaceWasVisible %d", aVisible, surfaceWasVisible);
  2075 
  2096 
  2076             TBool forcedUpdate = !surfaceWasVisible && !surfaceWasInvisible;
  2097             TBool forcedUpdate = !surfaceWasVisible && !surfaceWasInvisible;
       
  2098 
       
  2099 #ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS                    
       
  2100             if ( !aVisible && canvasVisual->LayerUsesAlphaFlag() )
       
  2101                 {
       
  2102                 __ALFLOGSTRING( "CAlfBridge::HandleLayerVisibility LayerUsesAlphaFlag setting visible" ); 
       
  2103                 aVisible = ETrue;
       
  2104                 }
       
  2105 #endif // SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS                    
  2077     
  2106     
  2078             if ( !aVisible && ( forcedUpdate || surfaceWasVisible ) )
  2107             if ( !aVisible && ( forcedUpdate || surfaceWasVisible ) )
  2079                 {
  2108                 {
  2080                 // notify surface observer that it has been hidden
  2109                 // notify surface observer that it has been hidden
  2081                 __ALFLOGSTRING("CAlfBridge::HideTarget >>");
  2110                 __ALFLOGSTRING("CAlfBridge::HideTarget >>");
  2475 				   engine->StartGroupEffect(groupId);
  2504 				   engine->StartGroupEffect(groupId);
  2476         		   }
  2505         		   }
  2477         	   iHuiEnv->ContinueRefresh();
  2506         	   iHuiEnv->ContinueRefresh();
  2478         	   break;
  2507         	   break;
  2479         	   }
  2508         	   }
       
  2509            case EAlfDSSetDistractionWindow:
       
  2510                {
       
  2511                HandleSetDistractionWindowL( data );
       
  2512                break;
       
  2513                }
  2480            case KUnInitialized:
  2514            case KUnInitialized:
  2481                {
  2515                {
  2482                __ALFLOGSTRING1("CAlfBridge::DoDispatchL: Received KUnInitialized: %d - CRITICAL ERROR!",data.iOp);
  2516                __ALFLOGSTRING1("CAlfBridge::DoDispatchL: Received KUnInitialized: %d - CRITICAL ERROR!",data.iOp);
  2483                USER_INVARIANT();
  2517                USER_INVARIANT();
  2484                }
  2518                }
  2616 	            if (parentViz)
  2650 	            if (parentViz)
  2617 	                {
  2651 	                {
  2618 	                viz->SetCanvasFlags(EHuiCanvasFlagEnableCanvasClipping);
  2652 	                viz->SetCanvasFlags(EHuiCanvasFlagEnableCanvasClipping);
  2619 	                viz->SetParentCanvas(parentViz);	                
  2653 	                viz->SetParentCanvas(parentViz);	                
  2620 	                }
  2654 	                }
  2621 	            else
       
  2622 	                {
       
  2623 	                __ALFLOGSTRING1("CAlfBridge::HandleNewWindowL: Parent not found for visual %d!",windowNodeId);    
       
  2624 	                }								
       
  2625 				}
  2655 				}
  2626 			else
  2656 			else
  2627 				{
  2657 				{
  2628 				__ALFLOGSTRING1("CAlfBridge::HandleNewWindowL: Control group not found for visual %d!",windowNodeId);    
  2658 				__ALFLOGSTRING1("CAlfBridge::HandleNewWindowL: Control group not found for visual 0x%x!",windowNodeId);    
  2629 				}    
  2659 				}    
  2630 
  2660 
  2631 			break; 
  2661 			break; 
  2632 			}
  2662 			}
  2633 		default:
  2663 		default:
  2672     RemoveImageBrushL(*aVisual);
  2702     RemoveImageBrushL(*aVisual);
  2673     CHuiLayout* layout = aVisual->Layout();
  2703     CHuiLayout* layout = aVisual->Layout();
  2674     if (layout)
  2704     if (layout)
  2675         layout->Remove(aVisual);
  2705         layout->Remove(aVisual);
  2676     aVisual->Owner().Remove(aVisual);
  2706     aVisual->Owner().Remove(aVisual);
       
  2707     RPointerArray<CHuiLayout> familyTree;
       
  2708     ListFamilyTreeL(familyTree, (CHuiLayout*)aVisual); // recursively dig the family tree
       
  2709     for (TInt familyIndex = 1; familyIndex < familyTree.Count();familyIndex++)
       
  2710         {
       
  2711         CHuiLayout* lVisual = familyTree[familyIndex];
       
  2712         lVisual->Owner().Remove(lVisual);
       
  2713         iOrphanStorage->AppendL( lVisual );
       
  2714         }
       
  2715     familyTree.Close();
       
  2716          
  2677     __ALFLOGSTRING1("CAlfBridge::HandleDestroyWindow - destroying visual 0x%x", aVisual);
  2717     __ALFLOGSTRING1("CAlfBridge::HandleDestroyWindow - destroying visual 0x%x", aVisual);
  2678     // check if visual is having an effect at the moment. This could occur, if options menu is exited (with effect) and then 
  2718     // check if visual is having an effect at the moment. This could occur, if options menu is exited (with effect) and then 
  2679     // application is exited. EHuiVisualFlagDrawOnlyAsExternalContent is indication that
  2719     // application is exited. EHuiVisualFlagDrawOnlyAsExternalContent is indication that
  2680     // there might be effect on this visual. It is not guaranteen.
  2720     // there might be effect on this visual. It is not guaranteen.
  2681     
  2721     
  5014         iHuiEnv->ContinueRefresh();
  5054         iHuiEnv->ContinueRefresh();
  5015         }
  5055         }
  5016     __ALFFXLOGSTRING("CAlfBridge::HandleGfxStopControlEffectsL - end");
  5056     __ALFFXLOGSTRING("CAlfBridge::HandleGfxStopControlEffectsL - end");
  5017     }
  5057     }
  5018 
  5058 
  5019 
  5059 void CAlfBridge::HandleSetDistractionWindowL( TAlfBridgerData data )
       
  5060     {
       
  5061     TInt windowGroupId = data.iInt1;
       
  5062     TInt windowClientHandle = data.iInt2;
       
  5063     TBool setDistractionWindow = (TBool)data.iPtr;
       
  5064         
       
  5065     CControlEffectState* fxData = new (ELeave) CControlEffectState;
       
  5066     CleanupStack::PushL(fxData);
       
  5067     fxData->ConstructL(windowClientHandle, windowGroupId, setDistractionWindow);
       
  5068 
       
  5069     __ALFFXLOGSTRING2("CAlfBridge::HandleSetDistractionWindowL client handle: %d, group: %d",  windowClientHandle, windowGroupId );
       
  5070     CHuiCanvasVisual* visual = FindVisualByClientSideIds(windowClientHandle, windowGroupId);
       
  5071     
       
  5072     iControlEffectData = fxData;
       
  5073     CleanupStack::Pop(fxData);
       
  5074     
       
  5075     if (visual)
       
  5076         {
       
  5077         HandleGfxControlEventL(*iControlEffectData, visual);
       
  5078         }
       
  5079     else
       
  5080         {
       
  5081         __ALFFXLOGSTRING2("CAlfBridge::HandleGfxControlEffectsL - Control not found. iClientHandle %d, iClientGroupHandle %d", 
       
  5082                 fxData->iClientHandle, 
       
  5083                 fxData->iClientGroupHandle);
       
  5084         return;
       
  5085         }
       
  5086     delete iControlEffectData;
       
  5087     iControlEffectData = NULL;
       
  5088     }
  5020 void CAlfBridge::HandleRegisterEffectL( TAlfBridgerData data )
  5089 void CAlfBridge::HandleRegisterEffectL( TAlfBridgerData data )
  5021     {     
  5090     {     
  5022     TInt action = data.iInt1;
  5091     TInt action = data.iInt1;
  5023     TInt length = data.iInt2;    
  5092     TInt length = data.iInt2;    
  5024     
  5093     
  5278     }
  5347     }
  5279 
  5348 
  5280 void CAlfBridge::HandleGfxControlEventL(CControlEffectState& aEvent,
  5349 void CAlfBridge::HandleGfxControlEventL(CControlEffectState& aEvent,
  5281         CHuiCanvasVisual* aCanvasVisual)
  5350         CHuiCanvasVisual* aCanvasVisual)
  5282     {
  5351     {
       
  5352 	
       
  5353     if (aEvent.iSetDistractionWindow) 
       
  5354         {
       
  5355 		// marks the background clear window that comes as courtesy of the framework.
       
  5356 		__ALFFXLOGSTRING2("CAlfBridge::HandleGfxControlEventL - setting distraction window 0x%x to state %d", aCanvasVisual, aEvent.iSetDistractionWindow);
       
  5357         switch(aEvent.iSetDistractionWindow)
       
  5358             {
       
  5359             case CControlEffectState::ESetDistractionWindow:
       
  5360                 {
       
  5361                 aCanvasVisual->SetCanvasFlags(EHuiCanvasFlagDistractionWindow);
       
  5362                 break;
       
  5363                 }
       
  5364             case CControlEffectState::ERemoveDistractionWindow:
       
  5365                 {
       
  5366                 aCanvasVisual->ClearCanvasFlags(EHuiCanvasFlagDistractionWindow);
       
  5367                 break;
       
  5368                 }
       
  5369             }
       
  5370         return;
       
  5371         }
       
  5372 		
       
  5373     if ( aCanvasVisual && aCanvasVisual->Owner().ControlGroup() && aCanvasVisual->Owner().ControlGroup()->SecureId() == 0x101f857A ) // Camera id
       
  5374         {
       
  5375         __ALFFXLOGSTRING("CAlfBridge::HandleGfxControlEventL - Returning because inside camera app");
       
  5376         return;
       
  5377         }
  5283     TInt err = KErrNone;
  5378     TInt err = KErrNone;
  5284     // Check if there is an effects engine in HuiEnv
  5379     // Check if there is an effects engine in HuiEnv
  5285     CHuiFxEffect* effect = NULL;
  5380     CHuiFxEffect* effect = NULL;
  5286     CHuiFxEngine* engine = NULL;
  5381     CHuiFxEngine* engine = NULL;
  5287     // engine is not owned by us, it is a member of HuiEnv
  5382     // engine is not owned by us, it is a member of HuiEnv
  6359     
  6454     
  6360     CAlfScreen* screen = iAlfScreens[0];
  6455     CAlfScreen* screen = iAlfScreens[0];
  6361     TRect fullscreen = TRect(TPoint(0,0), screen->Size());
  6456     TRect fullscreen = TRect(TPoint(0,0), screen->Size());
  6362     __ALFFXLOGSTRING3("CAlfBridge::IsFullScreenDrawn - new orientation %d, screen size: (%d,%d)", aOrientation, fullscreen.iBr.iX, fullscreen.iBr.iY );
  6457     __ALFFXLOGSTRING3("CAlfBridge::IsFullScreenDrawn - new orientation %d, screen size: (%d,%d)", aOrientation, fullscreen.iBr.iX, fullscreen.iBr.iY );
  6363     TBool fullscreenCovered = EFalse;
  6458     TBool fullscreenCovered = EFalse;
  6364     CAlfAppSrvSessionBase* topMostAlfSrvSession = NULL;
       
  6365         
  6459         
  6366     // Check if effect group has an effect with opaque hint.
  6460     // Check if effect group has an effect with opaque hint.
  6367     CHuiControlGroup& fxcontrolgroup = *(iAlfScreens[0]->iFullscreenEffectControlGroup);
  6461     CHuiControlGroup& fxcontrolgroup = *(iAlfScreens[0]->iFullscreenEffectControlGroup);
  6368     CHuiControl& fxcontrol = fxcontrolgroup.Control(0);
  6462     CHuiControl& fxcontrol = fxcontrolgroup.Control(0);
  6369     CHuiCanvasVisual* fxlayout = (CHuiCanvasVisual*)&fxcontrol.Visual(0);
  6463     CHuiCanvasVisual* fxlayout = (CHuiCanvasVisual*)&fxcontrol.Visual(0);
  6375         }
  6469         }
  6376     else if (fxExternalContent && IsOpaqueEffect(fxExternalContent->Effect()))
  6470     else if (fxExternalContent && IsOpaqueEffect(fxExternalContent->Effect()))
  6377         {
  6471         {
  6378         fullscreenCovered = ETrue;
  6472         fullscreenCovered = ETrue;
  6379         }    
  6473         }    
  6380     
  6474 
  6381     TBool alfWindowGroupFoundVisible = EFalse;
  6475     TBool alfClientWindowGroupVisible = EFalse;
  6382 
  6476     
  6383     AMT_SET_VALUE( iVisibleVisualCount, 0 );
  6477     AMT_SET_VALUE( iVisibleVisualCount, 0 );
  6384     
  6478     
  6385     // skip the topmost (effect) layer, start from floating sprite group
  6479     // skip the topmost (effect) layer, start from floating sprite group
  6386     for (TInt j=screen->iDisplay->Roster().Count() - screen->FixedControlGroupCount(); j>=0; j--)
  6480     for (TInt j=screen->iDisplay->Roster().Count() - screen->FixedControlGroupCount(); j>=0; j--)
  6387         {                
  6481         {                
  6400        
  6494        
  6401         // For optimization reasons, check if all visuals below in Z-order are covered    
  6495         // For optimization reasons, check if all visuals below in Z-order are covered    
  6402         if (!fullscreenCovered)
  6496         if (!fullscreenCovered)
  6403             {
  6497             {
  6404             fullscreenCovered = IsRectCoveredByRegion(fullscreen, iTempRegion);
  6498             fullscreenCovered = IsRectCoveredByRegion(fullscreen, iTempRegion);
  6405             
  6499             if(fullscreenCovered)
       
  6500                 {
       
  6501                 return ETrue;
       
  6502                 }
  6406             for(TInt ii=0;ii< iTempRegion.Count(); ii++)
  6503             for(TInt ii=0;ii< iTempRegion.Count(); ii++)
  6407                 {
  6504                 {
  6408                 __ALFFXLOGSTRING4("CAlfBridge::IsFullScreenDrawn (%d,%d)-(%d,%d)", iTempRegion[ii].iTl.iX, iTempRegion[ii].iTl.iY , iTempRegion[ii].iBr.iX, iTempRegion[ii].iBr.iY );
  6505                 __ALFFXLOGSTRING4("CAlfBridge::IsFullScreenDrawn (%d,%d)-(%d,%d)", iTempRegion[ii].iTl.iX, iTempRegion[ii].iTl.iY , iTempRegion[ii].iBr.iX, iTempRegion[ii].iBr.iY );
  6409                 }
  6506                 }
  6410             }
  6507             }
  6411         
  6508         
  6412         // Dont mess with alf control group visuals, alf session handling does it for us
  6509         // Dont mess with alf control group visuals, alf session handling does it for us
  6413         if (control.Role() == EAlfSessionContainer)
  6510         if (control.Role() == EAlfSessionContainer)
  6414             {
  6511             {
  6415             // Skip alf session containers until we have better heuristic implement for them
  6512             CHuiLayout* hostContainer = control.ContainerLayout( NULL );
       
  6513             TInt flags = hostContainer->Flags();            
       
  6514             if (alfClientWindowGroupVisible)
       
  6515                 {
       
  6516                 // check visual sizes if client has not made this control group hidden
       
  6517                 if(!(flags&EHuiVisualFlagUnderOpaqueHint))
       
  6518                     {
       
  6519                     if(iAppUi)
       
  6520                         {
       
  6521                         CAlfAppSrvSessionBase* alfSrvSession = iAppUi->SrvSessionForControlGroup(controlgroup);
       
  6522                         
       
  6523                         TInt clientWindowGroupId = alfSrvSession->ClientWindowGroup();
       
  6524                         // checking the case if there are multiple alf application openend.
       
  6525                         if (clientWindowGroupId == iAppUi->GetLastActiveClient())
       
  6526                             {
       
  6527                             if(IsFullScreenDrawnRecursiveAlfContent(hostContainer, fullscreen) )
       
  6528                                 {
       
  6529                                 return ETrue;
       
  6530                                 }
       
  6531                             }
       
  6532                         }
       
  6533                     }
       
  6534                 }
  6416             continue;
  6535             continue;
  6417             }
  6536             }
  6418         
  6537         
  6419         __ALFLOGSTRING1("CAlfBridge::IsFullScreenDraw - fullscreen covered %d", fullscreenCovered)
  6538         __ALFLOGSTRING1("CAlfBridge::IsFullScreenDraw - fullscreen covered %d", fullscreenCovered)
  6420         TBool subTreeCovered = EFalse;
  6539         TBool subTreeCovered = EFalse;
  6426             {
  6545             {
  6427             fullscreenCovered = IsOpaqueEffect(layout->Effect());
  6546             fullscreenCovered = IsOpaqueEffect(layout->Effect());
  6428             }                    
  6547             }                    
  6429         */    
  6548         */    
  6430        
  6549        
       
  6550         if(controlgroup.iAlfApp && layout->iOpacity.Now() > 0.0f )
       
  6551             {
       
  6552             alfClientWindowGroupVisible = ETrue;
       
  6553             }
       
  6554         
  6431         if (fullscreenCovered)
  6555         if (fullscreenCovered)
  6432             {
  6556             {
  6433             return ETrue;
  6557             return ETrue;
  6434             }
  6558             }
  6435         }
  6559         }
  6436     return fullscreenCovered;
  6560     return fullscreenCovered;
  6437     }
  6561     }
       
  6562 
       
  6563 TBool CAlfBridge::IsFullScreenDrawnRecursiveAlfContent(CHuiVisual* aVisual, TRect& aFullScreen)
       
  6564     {
       
  6565     if(aVisual)
       
  6566         {
       
  6567         TInt flags = aVisual->Flags();
       
  6568         if(!(flags && EHuiVisualFlagInactive) && aVisual->iOpacity.Now() > 0 ) // don't take inactive or invisible visual into account
       
  6569             {
       
  6570             TPoint point = aVisual->Pos().Now();
       
  6571             TPoint size = aVisual->Size().Now();
       
  6572             TRect visualRect(point, TSize(size.iX, size.iY));
       
  6573             iTempRegion.AddRect(visualRect);
       
  6574             iTempRegion.Tidy();
       
  6575 
       
  6576             if( IsRectCoveredByRegion(aFullScreen, iTempRegion) )
       
  6577                 {
       
  6578                 return ETrue;
       
  6579                 }
       
  6580             }
       
  6581         TInt count = aVisual->Count();
       
  6582         if(count)
       
  6583             {
       
  6584             for(TInt i = 0 ; i < count ; i++)
       
  6585                 {
       
  6586                 if( IsFullScreenDrawnRecursiveAlfContent( &aVisual->Visual(i), aFullScreen ) )
       
  6587                     {
       
  6588                     return ETrue;
       
  6589                     }
       
  6590                 }
       
  6591             }
       
  6592         }
       
  6593     return EFalse;
       
  6594     }
       
  6595 
  6438 
  6596 
  6439 TBool CAlfBridge::IsFullScreenDrawnRecursive(
  6597 TBool CAlfBridge::IsFullScreenDrawnRecursive(
  6440         CHuiLayout* aLayout, 
  6598         CHuiLayout* aLayout, 
  6441         CHuiControlGroup& aControlGroup,
  6599         CHuiControlGroup& aControlGroup,
  6442         CHuiControl& aControl,
  6600         CHuiControl& aControl,
  6513             aControlGroup.IsTransformed())
  6671             aControlGroup.IsTransformed())
  6514             {
  6672             {
  6515             visualIsOpaque = EFalse;    
  6673             visualIsOpaque = EFalse;    
  6516             }
  6674             }
  6517     
  6675     
  6518         if (visualIsActive && visualIsOpaque && !visualRectIsCovered)
  6676         if (visualIsActive && visualIsOpaque && !visualRectIsCovered 
       
  6677                 && !(canvasVisual->CanvasFlags() & EHuiCanvasFlagDistractionWindow) // exclude the akn clearer window from heuristics 
       
  6678                 )
  6519             { 
  6679             { 
  6520             // New visibility system takes only window shape into account.
  6680             // New visibility system takes only window shape into account.
  6521             if ( canvasVisual->CanvasFlags() & EHuiCanvasFlagIncludeToVisibilityCalculation )
  6681             if ( canvasVisual->CanvasFlags() & EHuiCanvasFlagIncludeToVisibilityCalculation )
  6522                 {                    
  6682                 {                    
  6523 				iTempRegion.AddRect(visualDisplayRect);
  6683 				iTempRegion.AddRect(visualDisplayRect);