diff options
| author | bernard.xiong <[email protected]> | 2010-01-14 10:03:50 +0000 |
|---|---|---|
| committer | bernard.xiong <[email protected]> | 2010-01-14 10:03:50 +0000 |
| commit | d06ac4f86c99310ddb2521764c9c5efbf466ec65 (patch) | |
| tree | bb0b89143aeb0facc2cdb665516a35ed81a67737 /rtgui/server | |
| parent | b7d3e0682cf5cfdd464da6f149d6a91e1fd1810d (diff) | |
add jpg image.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@303 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'rtgui/server')
| -rw-r--r-- | rtgui/server/server.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/rtgui/server/server.c b/rtgui/server/server.c index 5a7fe08a5e..48dff11fcf 100644 --- a/rtgui/server/server.c +++ b/rtgui/server/server.c @@ -303,9 +303,12 @@ void rtgui_server_handle_mouse_btn(struct rtgui_event_mouse* event) event->wid = RT_NULL; /* send mouse event to thread */ - rtgui_thread_send(rtgui_panel_get_active_thread(panel), - (struct rtgui_event*)event, - sizeof(struct rtgui_event_mouse)); + if (rtgui_panel_get_active_thread(panel) != RT_NULL) + { + rtgui_thread_send(rtgui_panel_get_active_thread(panel), + (struct rtgui_event*)event, + sizeof(struct rtgui_event_mouse)); + } } } @@ -381,10 +384,13 @@ void rtgui_server_handle_mouse_motion(struct rtgui_event_mouse* event) if (last_monitor_panel != RT_NULL) { rt_thread_t tid = rtgui_panel_get_active_thread(last_monitor_panel); - event->wid = RT_NULL; /* send mouse motion event */ - rtgui_thread_send(tid, &(event->parent), sizeof(struct rtgui_event_mouse)); + if (tid != RT_NULL) + { + event->wid = RT_NULL; + rtgui_thread_send(tid, &(event->parent), sizeof(struct rtgui_event_mouse)); + } } else if (last_monitor_topwin != RT_NULL) { @@ -403,7 +409,8 @@ void rtgui_server_handle_mouse_motion(struct rtgui_event_mouse* event) event->wid = RT_NULL; /* send mouse motion event */ - rtgui_thread_send(tid, &(event->parent), sizeof(struct rtgui_event_mouse)); + if (tid != RT_NULL) + rtgui_thread_send(tid, &(event->parent), sizeof(struct rtgui_event_mouse)); } } |
