From: keonpyo.kong Date: Tue, 16 Apr 2013 04:40:28 +0000 (+0900) Subject: Fix Focused control when AncestorVisibleState is changed X-Git-Tag: accepted/tizen_2.1/20130425.033138~186^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=64ef76e2ba820d839bdde1bfaca9fbbb7b3326b5;p=framework%2Fosp%2Fuifw.git Fix Focused control when AncestorVisibleState is changed Change-Id: Ia42e3a905e946950b593eab1ebcb83cbdf274e84 Signed-off-by: keonpyo.kong --- diff --git a/src/ui/FUi_Control.cpp b/src/ui/FUi_Control.cpp index f02801b..a900e51 100644 --- a/src/ui/FUi_Control.cpp +++ b/src/ui/FUi_Control.cpp @@ -881,6 +881,11 @@ _Control::OnVisibleStateChanged(void) void _Control::OnAncestorVisibleStateChanged(const _Control& control) { + _Control* pControl = GetFocused(); + if (pControl == this) + { + SetFocused(false); + } } void @@ -2842,6 +2847,20 @@ _Control::SetVisibleState(bool visibleState) if (visibleState == false) { + _Window* pTop = GetRootWindow(); + if (pTop) + { + if ((this) == pTop->GetFocusedControl()) + { + pTop->SetFocusedControl(null); + } + } + + _Control* pControl = GetFocused(); + if (pControl == this) + { + SetFocused(false); + } int owneeCount = GetOwneeCount(); for (int i = 0; i < owneeCount; ++i) { diff --git a/src/ui/controls/FUiCtrl_Toolbar.cpp b/src/ui/controls/FUiCtrl_Toolbar.cpp index 0434312..aec32e3 100644 --- a/src/ui/controls/FUiCtrl_Toolbar.cpp +++ b/src/ui/controls/FUiCtrl_Toolbar.cpp @@ -2899,6 +2899,7 @@ _Toolbar::OnAncestorVisibleStateChanged(const _Control& control) { __pToolbarPresenter->OnAncestorVisibleStateChanged(control); + _Control::OnAncestorVisibleStateChanged(control); return; }