summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
author[email protected] <[email protected]>2010-09-24 09:38:16 +0000
committer[email protected] <[email protected]>2010-09-24 09:38:16 +0000
commitbddae69d9c2e2b980cdeb6e1195517a6e8bee73a (patch)
tree6f0d517a829becdc12f932837fd9e591cb71f78d /components
parentcf2d8031cf1c0debae8f0ceef0765cbd8c1a3eba (diff)
fix view and workbench destroy issue.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@943 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components')
-rw-r--r--components/rtgui/server/server.c18
-rw-r--r--components/rtgui/widgets/workbench.c6
2 files changed, 14 insertions, 10 deletions
diff --git a/components/rtgui/server/server.c b/components/rtgui/server/server.c
index 4b143438fc..65f5d6b321 100644
--- a/components/rtgui/server/server.c
+++ b/components/rtgui/server/server.c
@@ -136,7 +136,6 @@ void rtgui_server_thread_panel_hide(struct rtgui_event_panel_hide* event)
if (panel != RT_NULL)
{
rt_thread_t tid;
- struct rtgui_event_paint epaint;
/* send the responses */
rtgui_thread_ack(RTGUI_EVENT(event), RTGUI_STATUS_OK);
@@ -153,15 +152,20 @@ void rtgui_server_thread_panel_hide(struct rtgui_event_panel_hide* event)
rtgui_list_append(&(panel->thread_list), &(thread->list));
}
- /* get new active thread */
- tid = rtgui_panel_get_active_thread(panel);
/* send all topwin clip info */
rtgui_topwin_update_clip_to_panel(panel);
- /* send paint event */
- RTGUI_EVENT_PAINT_INIT(&epaint);
- epaint.wid = RT_NULL;
- rtgui_thread_send(tid, (struct rtgui_event*)&epaint, sizeof(epaint));
+ /* get new active thread */
+ tid = rtgui_panel_get_active_thread(panel);
+ if (tid != RT_NULL)
+ {
+ struct rtgui_event_paint epaint;
+
+ /* send paint event */
+ RTGUI_EVENT_PAINT_INIT(&epaint);
+ epaint.wid = RT_NULL;
+ rtgui_thread_send(tid, (struct rtgui_event*)&epaint, sizeof(epaint));
+ }
}
else
{
diff --git a/components/rtgui/widgets/workbench.c b/components/rtgui/widgets/workbench.c
index c3409db584..fd203f91e0 100644
--- a/components/rtgui/widgets/workbench.c
+++ b/components/rtgui/widgets/workbench.c
@@ -135,9 +135,6 @@ void rtgui_workbench_destroy(rtgui_workbench_t* workbench)
{
RT_ASSERT(workbench != RT_NULL);
- /* hide workbench firstly */
- rtgui_workbench_hide(workbench);
-
if (RTGUI_TOPLEVEL(workbench)->server != RT_NULL)
{
struct rtgui_event_panel_detach edetach;
@@ -398,6 +395,9 @@ rt_bool_t rtgui_workbench_event_handler(rtgui_widget_t* widget, rtgui_event_t* e
{
rtgui_view_t* view;
+ /* un-hide workbench */
+ RTGUI_WIDGET_UNHIDE(widget);
+
/* paint a view */
view = workbench->current_view;
if (view != RT_NULL)