idlehomescreen/xmluirendering/uiengine/src/xnkeyeventdispatcher.cpp
branchRCL_3
changeset 15 ff572dfe6d86
parent 2 08c6ee43b396
child 16 9674c1a575e9
--- a/idlehomescreen/xmluirendering/uiengine/src/xnkeyeventdispatcher.cpp	Fri Feb 19 22:42:37 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnkeyeventdispatcher.cpp	Fri Mar 12 15:41:49 2010 +0200
@@ -195,7 +195,7 @@
             {
             CEikCba* cba = 
                 static_cast< CEikCba* >( iCbaContainer->ButtonGroup() ); 
-                    
+                
             if ( destination == cba && iCbaContainer->IsVisible() )
                 {
                 CXnMenuAdapter* adapter( MenuAdapter( iMenuNode ) );
@@ -205,6 +205,18 @@
                     TRAP_IGNORE( 
                         adapter->HandlePointerEventL( *aEvent.Pointer() ) );
                     }
+
+                // if focus was lost due to longtap & button not being released
+                // appui will set flag to ignorekeyevent for this control as it has
+                // lost focus ( voice command become active ) after longtap detected.
+                // this causes cba button to stay in pressed state. send this buttonup
+                // event manually so that cba can draw itself correctly 
+                // case id: ou1cimx1#265200
+                if ( event.iType == TPointerEvent::EButton1Up &&
+                    !cba->IsFocused() )
+                    {
+                    TRAP_IGNORE( cba->HandlePointerEventL( event ) );
+                    }
                 }
             }
         }
@@ -480,7 +492,10 @@
             }
         else
             {
-            iCbaContainer->MakeVisible( ETrue );
+            if ( !iCbaContainer->IsVisible() )
+                {
+                iCbaContainer->MakeVisible( ETrue );
+                }            
             }
         }
     else
@@ -616,10 +631,10 @@
             CXnViewData& activeViewData(
                 iUiEngine.ViewManager()->ActiveViewData() );
     
-            const CXnPluginData& pluginData(
+            const CXnPluginData* pluginData(
                 activeViewData.Plugin( iNode ) );
     
-            if ( &pluginData == &aPluginData )
+            if ( pluginData == &aPluginData )
                 {
                 // The plugin is removed which was holding focus
                 ClearStateL();
@@ -661,10 +676,10 @@
         // first, search only in plugins which have popup window open
         for ( TInt i = 0; i < list.Count(); i++ )
             {
-            CXnPluginData& plugin( activeView.Plugin( list[i] ) );
-            if ( plugin.IsDisplayingPopup() )
+            CXnPluginData* plugin( activeView.Plugin( list[i] ) );
+            if ( plugin && plugin->IsDisplayingPopup() )
                 {
-                plugin.InitialFocusNodesL( initial );
+                plugin->InitialFocusNodesL( initial );
                 }
             }
         
@@ -674,8 +689,11 @@
             {        
             for ( TInt i = 0; i < list.Count(); i++ )
                 {
-                CXnPluginData& plugin( activeView.Plugin( list[i] ) );
-                plugin.InitialFocusNodesL( initial );
+                CXnPluginData* plugin( activeView.Plugin( list[i] ) );
+                if ( plugin )
+                    {
+                    plugin->InitialFocusNodesL( initial );
+                    }
                 }
             }