/** * set this application as window manager */ rt_err_t rtgui_app_set_as_wm(void) { rt_thread_t srv_tid; struct rtgui_event_set_wm event; struct rtgui_app* app; srv_tid = rtgui_get_server(); app = rtgui_app_self(); if (app != RT_NULL && srv_tid != RT_NULL) { /* notify rtgui server, this is a window manager */ RTGUI_EVENT_SET_WM_INIT(&event); event.app = app; rtgui_send_sync(srv_tid, RTGUI_EVENT(&event), sizeof(event)); return RT_EOK; } return RT_ERROR; }
/** * set this application as window manager */ rt_err_t rtgui_app_set_as_wm(struct rtgui_app *app) { struct rtgui_app *srv_app; struct rtgui_event_set_wm event; _rtgui_application_check(app); srv_app = rtgui_get_server(); if (srv_app != RT_NULL) { /* notify rtgui server, this is a window manager */ RTGUI_EVENT_SET_WM_INIT(&event); event.app = app; rtgui_send_sync(srv_app, RTGUI_EVENT(&event), sizeof(event)); return RT_EOK; } return RT_ERROR; }