idlehomescreen/xmluirendering/uiengine/src/xnviewcontroladapter.cpp
branchRCL_3
changeset 26 1b758917cafc
parent 25 137ebc85284b
equal deleted inserted replaced
25:137ebc85284b 26:1b758917cafc
    39 //
    39 //
    40 static void ResetGrabbingL( CXnControlAdapter* aControl, 
    40 static void ResetGrabbingL( CXnControlAdapter* aControl, 
    41     const TPointerEvent& aEvent ) 
    41     const TPointerEvent& aEvent ) 
    42     {       
    42     {       
    43     if ( aControl )
    43     if ( aControl )
    44         {                              
    44         {
    45         CCoeControl* grabber( aControl->GrabbingComponent() );
    45         CCoeControl* grabber( aControl->GrabbingComponent() );
    46         
    46         
    47         if ( grabber )
    47         if ( grabber )
    48             {                        
    48             {
       
    49             // cancel longtap detector before reset grabbing.
       
    50             CAknLongTapDetector* detector = aControl->LongTapDetector();
       
    51             if ( detector && detector->IsActive() )
       
    52                 {
       
    53                 detector->Cancel();
       
    54                 }
    49             grabber->IgnoreEventsUntilNextPointerUp();
    55             grabber->IgnoreEventsUntilNextPointerUp();
    50             
    56             
    51             aControl->CCoeControl::HandlePointerEventL( aEvent );
    57             aControl->CCoeControl::HandlePointerEventL( aEvent );
    52             
    58             
    53             CXnControlAdapter* adapter = 
    59             CXnControlAdapter* adapter = 
    54                 dynamic_cast< CXnControlAdapter* >( grabber );
    60                 dynamic_cast< CXnControlAdapter* >( grabber );
    55             
    61             
    56             ResetGrabbingL( adapter, aEvent );            
    62             ResetGrabbingL( adapter, aEvent );
    57             }        
    63             }        
    58         }    
    64         }    
    59     }
    65     }
    60 
    66 
    61 // ============================ MEMBER FUNCTIONS ===============================
    67 // ============================ MEMBER FUNCTIONS ===============================
   180 // -----------------------------------------------------------------------------
   186 // -----------------------------------------------------------------------------
   181 //
   187 //
   182 void CXnViewControlAdapter::HandlePointerEventL( 
   188 void CXnViewControlAdapter::HandlePointerEventL( 
   183     const TPointerEvent& aPointerEvent )
   189     const TPointerEvent& aPointerEvent )
   184     {    
   190     {    
   185     iAppUi.UiEngine().DisableRenderUiLC();
   191     if ( iForegroundStatus != EBackground )
   186         
   192         {
   187     CXnControlAdapter::HandlePointerEventL( aPointerEvent );
   193         iAppUi.UiEngine().DisableRenderUiLC();
   188     
   194             
   189     iAppUi.UiEngine().RenderUIL();
   195         CXnControlAdapter::HandlePointerEventL( aPointerEvent );
   190     
   196         
   191     CleanupStack::PopAndDestroy();    
   197         iAppUi.UiEngine().RenderUIL();
       
   198         
       
   199         CleanupStack::PopAndDestroy();    
       
   200         }
   192     }
   201     }
   193 
   202 
   194 // -----------------------------------------------------------------------------
   203 // -----------------------------------------------------------------------------
   195 // CXnViewControlAdapter::ResetGrabbing()
   204 // CXnViewControlAdapter::ResetGrabbing()
   196 // 
   205 // 
   213 // 
   222 // 
   214 // -----------------------------------------------------------------------------
   223 // -----------------------------------------------------------------------------
   215 //
   224 //
   216 void CXnViewControlAdapter::NotifyForegroundChanged( TForegroundStatus aStatus )
   225 void CXnViewControlAdapter::NotifyForegroundChanged( TForegroundStatus aStatus )
   217     {
   226     {
       
   227     iForegroundStatus = aStatus;
   218     if ( aStatus == EBackground || aStatus == EPartialForeground )
   228     if ( aStatus == EBackground || aStatus == EPartialForeground )
   219         {
   229         {
   220         ResetGrabbing();
   230         ResetGrabbing();
   221         }
   231         }
   222     }
   232     }