1479 } |
1479 } |
1480 case EEventFocusLost: |
1480 case EEventFocusLost: |
1481 { |
1481 { |
1482 // If focus window group is not this application nor window server, |
1482 // If focus window group is not this application nor window server, |
1483 // then this application can not be in focus. |
1483 // then this application can not be in focus. |
1484 const TInt windowGroupId = |
1484 const TInt windowGroupId = GetFocusWindowGroupId(); |
1485 iCoeEnv->WsSession().GetFocusWindowGroup(); |
|
1486 |
1485 |
1487 if ( ( windowGroupId != iThisApplicationWgId ) && |
1486 if ( ( windowGroupId != iThisApplicationWgId ) && |
1488 ( windowGroupId != iEikonServerWgId ) && |
1487 ( windowGroupId != iEikonServerWgId ) && |
1489 ( windowGroupId != iAknCapServerWgId ) && |
1488 ( windowGroupId != iAknCapServerWgId ) && |
1490 ( windowGroupId != iAknNfyServerWgId ) || partialForeGroundlost ) |
1489 ( windowGroupId != iAknNfyServerWgId ) || partialForeGroundlost ) |
1548 |
1547 |
1549 // All events are sent to base class. |
1548 // All events are sent to base class. |
1550 CAknAppUi::HandleWsEventL( aEvent, aDestination ); |
1549 CAknAppUi::HandleWsEventL( aEvent, aDestination ); |
1551 __VTPRINTEXIT( "VtUi.HandleWsEventL" ) |
1550 __VTPRINTEXIT( "VtUi.HandleWsEventL" ) |
1552 } |
1551 } |
|
1552 |
|
1553 // ----------------------------------------------------------------------------- |
|
1554 // CVtUiAppUi::GetFocusWindowGroupId |
|
1555 // ----------------------------------------------------------------------------- |
|
1556 // |
|
1557 TInt CVtUiAppUi::GetFocusWindowGroupId() |
|
1558 { |
|
1559 __VTPRINTENTER( "VtUi.GetFocusWindowGroupId" ) |
|
1560 RWsSession& ws = iCoeEnv->WsSession(); |
|
1561 RArray<RWsSession::TWindowGroupChainInfo>* allWgIds = |
|
1562 new (ELeave) RArray<RWsSession::TWindowGroupChainInfo>( 4 ); |
|
1563 |
|
1564 CleanupDeletePushL( allWgIds ); |
|
1565 CleanupClosePushL( *allWgIds ); |
|
1566 |
|
1567 User::LeaveIfError( ws.WindowGroupList( 0, allWgIds) ); |
|
1568 |
|
1569 const TInt chainCount = allWgIds->Count(); |
|
1570 |
|
1571 RApaLsSession appArcSession; |
|
1572 User::LeaveIfError( appArcSession.Connect() ); |
|
1573 |
|
1574 appArcSession.GetAllApps(); |
|
1575 |
|
1576 CApaWindowGroupName* windowName; |
|
1577 TInt firstAppWgId = KErrNone; |
|
1578 for ( TInt index=0; index < chainCount; index++ ) |
|
1579 { |
|
1580 RWsSession::TWindowGroupChainInfo& info = (*allWgIds)[index]; |
|
1581 if ( info.iParentId <= 0 ) |
|
1582 { |
|
1583 TInt wgId=info.iId; |
|
1584 windowName = CApaWindowGroupName::NewLC(ws, wgId); |
|
1585 TUid applicationUid = windowName->AppUid(); |
|
1586 |
|
1587 // application screen (0 = main screen, 1 = cover ui ) |
|
1588 // the possible error value is omitted |
|
1589 TInt appScreen = -1; |
|
1590 TInt errId = appArcSession.GetDefaultScreenNumber( appScreen, applicationUid ); |
|
1591 if ( errId != KErrNone ) |
|
1592 { |
|
1593 CleanupStack::PopAndDestroy( windowName ); //windowName |
|
1594 continue; |
|
1595 } |
|
1596 if ( firstAppWgId == KErrNone && ( appScreen == 0 || appScreen == -1 ) ) |
|
1597 { |
|
1598 firstAppWgId = wgId; // firstAppWgId should be the top windows group id. |
|
1599 } |
|
1600 |
|
1601 CleanupStack::PopAndDestroy(); //windowName |
|
1602 } |
|
1603 } |
|
1604 __VTPRINTEXIT( "VtUi.GetFocusWindowGroupId" ) |
|
1605 return firstAppWgId; |
|
1606 } |
|
1607 |
1553 |
1608 |
1554 // ----------------------------------------------------------------------------- |
1609 // ----------------------------------------------------------------------------- |
1555 // CVtUiAppUi::PreHandleKeyEventL |
1610 // CVtUiAppUi::PreHandleKeyEventL |
1556 // |
1611 // |
1557 // ----------------------------------------------------------------------------- |
1612 // ----------------------------------------------------------------------------- |
2257 |
2312 |
2258 case EVtUiCmdGoToIdle: |
2313 case EVtUiCmdGoToIdle: |
2259 CmdGoToIdleL(); |
2314 CmdGoToIdleL(); |
2260 break; |
2315 break; |
2261 |
2316 |
|
2317 // Dial emergency call |
|
2318 case EVtUiCmdDialerEmergencyCall: |
|
2319 __VTPRINT( DEBUG_GEN, "VtUiHandleCommand.CmdEmergencyCall" ); |
|
2320 CmdSimulateKeyEvent( EStdKeyYes ); |
|
2321 break; |
2262 // Object sharing related |
2322 // Object sharing related |
2263 |
2323 |
2264 case EVtUiCmdShareObjectImage: |
2324 case EVtUiCmdShareObjectImage: |
2265 CmdInitializeShareImageL( refresh ); |
2325 CmdInitializeShareImageL( refresh ); |
2266 break; |
2326 break; |
4919 else |
4979 else |
4920 { |
4980 { |
4921 __VTPRINT( DEBUG_GEN, |
4981 __VTPRINT( DEBUG_GEN, |
4922 "VtUi.DoLayoutChg KVtEngHandleLayoutChange == KErrNotReady (ok)" ) |
4982 "VtUi.DoLayoutChg KVtEngHandleLayoutChange == KErrNotReady (ok)" ) |
4923 TVtEngCommandId pendingCommand = Model().CommandHandler().PendingCommand(); |
4983 TVtEngCommandId pendingCommand = Model().CommandHandler().PendingCommand(); |
|
4984 TVtEngCommandId invalidCommand = Model().CommandHandler().InvalidCommand(); |
4924 if ( pendingCommand == KVtEngMuteOutgoingAudio || |
4985 if ( pendingCommand == KVtEngMuteOutgoingAudio || |
4925 pendingCommand == KVtEngUnmuteOutgoingAudio || |
4986 pendingCommand == KVtEngUnmuteOutgoingAudio || |
4926 pendingCommand == KVtEngSetAudioRouting || |
4987 pendingCommand == KVtEngSetAudioRouting || |
4927 pendingCommand == KVtEngSetAudioVolume || |
4988 pendingCommand == KVtEngSetAudioVolume || |
4928 pendingCommand == KVtEngSetSource || |
4989 pendingCommand == KVtEngSetSource || |
4929 pendingCommand == KVtEngPrepareCamera || |
4990 pendingCommand == KVtEngPrepareCamera || |
4930 pendingCommand == KVtEngUnfreeze ) |
4991 pendingCommand == KVtEngUnfreeze || |
|
4992 invalidCommand == KVtEngHandleLayoutChange ) |
4931 { |
4993 { |
4932 iUiStates->SetLayoutChangeNeeded( ETrue ); |
4994 iUiStates->SetLayoutChangeNeeded( ETrue ); |
4933 } |
4995 } |
4934 } |
4996 } |
4935 // Notify component manager |
4997 // Notify component manager |
6975 aCommand == KVtEngUnmuteOutgoingAudio || |
7037 aCommand == KVtEngUnmuteOutgoingAudio || |
6976 aCommand == KVtEngSetAudioRouting || |
7038 aCommand == KVtEngSetAudioRouting || |
6977 aCommand == KVtEngSetAudioVolume || |
7039 aCommand == KVtEngSetAudioVolume || |
6978 aCommand == KVtEngSetSource || |
7040 aCommand == KVtEngSetSource || |
6979 aCommand == KVtEngPrepareCamera || |
7041 aCommand == KVtEngPrepareCamera || |
6980 aCommand == KVtEngUnfreeze ) ) |
7042 aCommand == KVtEngUnfreeze || |
|
7043 aCommand == KVtEngHandleLayoutChange ) ) |
6981 { |
7044 { |
6982 iAppUi.iUiStates->SetLayoutChangeNeeded( EFalse ); |
7045 iAppUi.iUiStates->SetLayoutChangeNeeded( EFalse ); |
6983 iAppUi.DoHandleLayoutChangedL(); |
7046 iAppUi.DoHandleLayoutChangedL(); |
6984 } |
7047 } |
6985 __VTPRINTEXITR( "VtUiComms.HandleVTCommandPerformedL %d", 1 ) |
7048 __VTPRINTEXITR( "VtUiComms.HandleVTCommandPerformedL %d", 1 ) |