47 |
47 |
48 #include <AknTasHook.h> // for testability hooks |
48 #include <AknTasHook.h> // for testability hooks |
49 #include "akntrace.h" |
49 #include "akntrace.h" |
50 const TInt EEikDialogFlagSleeping =0x20000; |
50 const TInt EEikDialogFlagSleeping =0x20000; |
51 |
51 |
|
52 |
|
53 |
52 // ----------------------------------------------------------------------------- |
54 // ----------------------------------------------------------------------------- |
53 // Finds out if this control belongs to the window group that is in focus. |
55 // Finds out if this control belongs to the window group that is in focus. |
54 // This information can be used to skip effects when the window group is |
56 // This information can be used to skip effects when the window group is not visible. |
55 // not visible. |
|
56 // |
57 // |
57 // @param aThis The control in question. |
58 // @param aControl The control in question. |
58 // |
59 // |
59 // @return ETrue if the window group is in focus, otherwise EFalse |
60 // @return ETrue if the window group is in focus, otherwise EFalse |
60 // ----------------------------------------------------------------------------- |
61 // ----------------------------------------------------------------------------- |
61 // |
62 // |
62 TBool IsFocusedWindowGroup( CAknNoteDialog* aThis ) |
63 TBool IsFocusedWindowGroup( const CCoeControl* aControl ) |
63 { |
64 { |
64 RWindowTreeNode* node = aThis->DrawableWindow(); |
65 if( !aControl ) |
|
66 { |
|
67 return EFalse; |
|
68 } |
|
69 |
|
70 RWindowTreeNode* node = aControl->DrawableWindow(); |
|
71 |
65 // this code finds out if this control belongs to window group |
72 // this code finds out if this control belongs to window group |
66 // that is in focus, there are some rare cases when the latest opened |
73 // that is in focus, there are some rare cases when the latest opened |
67 // popup goes behind another one (e.g. system lock query -> power key menu) |
74 // popup goes behind another one (e.g. system lock query -> power key menu) |
68 // we don't want transition in that case |
75 // we don't want transition in that case |
69 RWsSession& wsSession = CEikonEnv::Static()->WsSession(); |
76 RWsSession& wsSession = CEikonEnv::Static()->WsSession(); |
70 |
77 |
71 if ( !node ) |
78 if ( !node ) |
72 { |
79 { |
73 return EFalse; |
80 return EFalse; |
74 } |
81 } |
|
82 |
75 TInt nodeWindowGroupId = node->WindowGroupId(); |
83 TInt nodeWindowGroupId = node->WindowGroupId(); |
76 TInt focusedWindowGroupId = wsSession.GetFocusWindowGroup(); |
84 TInt focusedWindowGroupId = wsSession.GetFocusWindowGroup(); |
77 |
85 |
78 if ( nodeWindowGroupId == focusedWindowGroupId ) |
86 if ( nodeWindowGroupId == focusedWindowGroupId ) |
79 { |
87 { |
80 return aThis->IsFocused(); |
88 return aControl->IsFocused(); |
81 } |
89 } |
82 |
90 |
83 TInt count = wsSession.NumWindowGroups( 0 ); |
91 TInt count = wsSession.NumWindowGroups( 0 ); |
84 |
92 |
85 // because there is not leave here,so no need to use CleanupStack. |
93 // because there is not leave here,so no need to use CleanupStack. |
438 _AKNTRACE_FUNC_ENTER; |
447 _AKNTRACE_FUNC_ENTER; |
439 CAknNoteDialog* self = REINTERPRET_CAST(CAknNoteDialog*,aThis); |
448 CAknNoteDialog* self = REINTERPRET_CAST(CAknNoteDialog*,aThis); |
440 |
449 |
441 #ifdef RD_UI_TRANSITION_EFFECTS_POPUPS |
450 #ifdef RD_UI_TRANSITION_EFFECTS_POPUPS |
442 if ( self->IsVisible() && GfxTransEffect::IsRegistered( self ) && |
451 if ( self->IsVisible() && GfxTransEffect::IsRegistered( self ) && |
443 IsFocusedWindowGroup( self ) ) |
452 IsFocusedWindowGroup( self ) ) |
444 { |
453 { |
445 TBool rsWasEnabled( EFalse ); |
454 TBool rsWasEnabled( EFalse ); |
446 if( !CAknEnv::Static()->TransparencyEnabled() && self->DrawableWindow() && self->Window().IsRedrawStoreEnabled() ) |
455 if( !CAknEnv::Static()->TransparencyEnabled() && self->DrawableWindow() && self->Window().IsRedrawStoreEnabled() ) |
447 { |
456 { |
448 rsWasEnabled = ETrue; |
457 rsWasEnabled = ETrue; |