summaryrefslogtreecommitdiff
path: root/components/rtgui/widgets/view.c
diff options
context:
space:
mode:
authorbernard.xiong <[email protected]>2010-08-10 07:25:08 +0000
committerbernard.xiong <[email protected]>2010-08-10 07:25:08 +0000
commitaa35bccfee9008d03f8a1f7de79655f409a39228 (patch)
tree26563564ceec9f384a1721c156fad18176c7e45f /components/rtgui/widgets/view.c
parent50eb24dfe7675d3606c33aefd008f0ad13ee6c3e (diff)
fix view focus bug.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@840 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/rtgui/widgets/view.c')
-rw-r--r--components/rtgui/widgets/view.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/components/rtgui/widgets/view.c b/components/rtgui/widgets/view.c
index 04cbc79a34..4a7dfe12e6 100644
--- a/components/rtgui/widgets/view.c
+++ b/components/rtgui/widgets/view.c
@@ -148,8 +148,13 @@ rtgui_modal_code_t rtgui_view_show(rtgui_view_t* view, rt_bool_t is_modal)
workbench = RTGUI_WORKBENCH(RTGUI_WIDGET(view)->parent);
rtgui_workbench_show_view(workbench, view);
- if (RTGUI_WIDGET_IS_FOCUSABLE(RTGUI_WIDGET(view)))
- rtgui_widget_focus(RTGUI_WIDGET(view));
+ if (RTGUI_CONTAINER(view)->focused != RT_NULL)
+ rtgui_widget_focus(RTGUI_CONTAINER(view)->focused);
+ else
+ {
+ if (RTGUI_WIDGET_IS_FOCUSABLE(RTGUI_WIDGET(view)))
+ rtgui_widget_focus(RTGUI_WIDGET(view));
+ }
view->modal_show = is_modal;
if (is_modal == RT_TRUE)