bringup RAIL only when we receive a RAIL command

This commit is contained in:
Laxmikant Rashinkar 2014-01-31 19:57:52 -08:00
parent ec4791ac40
commit b205654e78
2 changed files with 84 additions and 74 deletions

View File

@ -547,7 +547,7 @@ process_message_channel_setup(struct stream *s)
g_rdpdr_chan_id = ci->id; g_rdpdr_chan_id = ci->id;
} }
/* disabled for now */ /* disabled for now */
else if (g_strcasecmp(ci->name, "notrail") == 0) else if (g_strcasecmp(ci->name, "rail") == 0)
{ {
g_rail_index = g_num_chan_items; g_rail_index = g_num_chan_items;
g_rail_chan_id = ci->id; g_rail_chan_id = ci->id;

View File

@ -330,20 +330,43 @@ rail_is_another_wm_running(void)
/*****************************************************************************/ /*****************************************************************************/
int APP_CC int APP_CC
rail_init(void) rail_init(void)
{
LOG(10, ("chansrv::rail_init:"));
xcommon_init();
return 0;
}
/*****************************************************************************/
int APP_CC
rail_deinit(void)
{
if (g_rail_up)
{
list_delete(g_window_list);
g_window_list = 0;
/* no longer window manager */
XSelectInput(g_display, g_root_window, 0);
g_rail_up = 0;
}
return 0;
}
int APP_CC
rail_startup()
{ {
int dummy; int dummy;
int ver_maj; int ver_maj;
int ver_min; int ver_min;
Status st; Status st;
LOG(10, ("chansrv::rail_init:"));
xcommon_init();
if (rail_is_another_wm_running()) if (rail_is_another_wm_running())
{ {
log_message(LOG_LEVEL_ERROR, "rail_init: another window manager " log_message(LOG_LEVEL_ERROR, "rail_init: another window manager "
"is running"); "is running");
} }
list_delete(g_window_list); list_delete(g_window_list);
g_window_list = list_create(); g_window_list = list_create();
rail_send_init(); rail_send_init();
@ -372,21 +395,6 @@ rail_init(void)
g_default_cursor = XCreateFontCursor(g_display, XC_left_ptr); g_default_cursor = XCreateFontCursor(g_display, XC_left_ptr);
XDefineCursor(g_display, g_root_window, g_default_cursor); XDefineCursor(g_display, g_root_window, g_default_cursor);
} }
return 0;
}
/*****************************************************************************/
int APP_CC
rail_deinit(void)
{
if (g_rail_up)
{
list_delete(g_window_list);
g_window_list = 0;
/* no longer window manager */
XSelectInput(g_display, g_root_window, 0);
g_rail_up = 0;
}
return 0; return 0;
} }
@ -454,6 +462,8 @@ rail_process_exec(struct stream *s, int size)
if (g_strlen(ExeOrFile) > 0) if (g_strlen(ExeOrFile) > 0)
{ {
rail_startup();
LOG(10, ("rail_process_exec: pre")); LOG(10, ("rail_process_exec: pre"));
/* ask main thread to fork */ /* ask main thread to fork */
tc_mutex_lock(g_exec_mutex); tc_mutex_lock(g_exec_mutex);