if (sm_conn) {
/* if permanent is true then we will change our session state so that
the SM won't run us again */
- session_setup_restart_style(!permanent);
+ if (permanent)
+ session_setup_restart_style(FALSE);
SmcCloseConnection(sm_conn, 0, NULL);
&cb, oldid, &ob_sm_id,
SM_ERR_LEN-1, sm_err);
g_free(oldid);
+ ob_debug_type(OB_DEBUG_SM, "Connected to SM with id: %s\n", ob_sm_id);
if (sm_conn == NULL)
ob_debug("Failed to connect to session manager: %s\n", sm_err);
return sm_conn != NULL;
.vals = &vals
};
SmProp *list = ∝
+ ob_debug_type(OB_DEBUG_SM, "Setting program: %s\n", sm_argv[0]);
SmcSetProperties(sm_conn, 1, &list);
g_free(prop.name);
g_free(prop.type);
.vals = &vals
};
SmProp *list = ∝
+ ob_debug_type(OB_DEBUG_SM, "Setting user: %s\n", user);
SmcSetProperties(sm_conn, 1, &list);
g_free(prop.name);
g_free(prop.type);
static void session_setup_restart_style(gboolean restart)
{
- char restart_hint = restart ? SmRestartImmediately : SmRestartIfRunning;
+ gchar restart_hint = restart ? SmRestartImmediately : SmRestartIfRunning;
SmPropValue vals = {
.value = &restart_hint,
.vals = &vals
};
SmProp *list = ∝
+ ob_debug_type(OB_DEBUG_SM, "Setting restart: %d\n", restart);
SmcSetProperties(sm_conn, 1, &list);
g_free(prop.name);
g_free(prop.type);
.vals = &vals
};
SmProp *list = ∝
+ ob_debug_type(OB_DEBUG_SM, "Setting pid: %s\n", pid);
SmcSetProperties(sm_conn, 1, &list);
g_free(prop.name);
g_free(prop.type);
.vals = &vals
};
SmProp *list = ∝
+ ob_debug_type(OB_DEBUG_SM, "Setting priority: %d\n", priority);
SmcSetProperties(sm_conn, 1, &list);
g_free(prop.name);
g_free(prop.type);
.num_vals = sm_argc,
.vals = vals
};
+ SmProp *list = ∝
+ ob_debug_type(OB_DEBUG_SM, "Setting clone command: (%d)\n", sm_argc);
for (i = 0; i < sm_argc; ++i) {
vals[i].value = sm_argv[i];
vals[i].length = strlen(sm_argv[i]) + 1;
+ ob_debug_type(OB_DEBUG_SM, " %s\n", vals[i].value);
}
- SmProp *list = ∝
SmcSetProperties(sm_conn, 1, &list);
g_free(prop.name);
g_free(prop.type);
.num_vals = sm_argc + 4,
.vals = vals
};
+ SmProp *list = ∝
+ ob_debug_type(OB_DEBUG_SM, "Setting restart command: (%d)\n", sm_argc+4);
for (i = 0; i < sm_argc; ++i) {
vals[i].value = sm_argv[i];
vals[i].length = strlen(sm_argv[i]) + 1;
+ ob_debug_type(OB_DEBUG_SM, " %s\n", vals[i].value);
}
- vals[i].value = g_strdup("--sm-save-file");
- vals[i].length = strlen("--sm-save-file") + 1;
- vals[i+1].value = ob_sm_save_file;
- vals[i+1].length = strlen(ob_sm_save_file) + 1;
+ vals[i].value = g_strdup("--sm-client-id");
+ vals[i].length = strlen("--sm-client-id") + 1;
+ vals[i+1].value = ob_sm_id;
+ vals[i+1].length = strlen(ob_sm_id) + 1;
+ ob_debug_type(OB_DEBUG_SM, " %s\n", vals[i].value);
+ ob_debug_type(OB_DEBUG_SM, " %s\n", vals[i+1].value);
- vals[i+2].value = g_strdup("--sm-client-id");
- vals[i+2].length = strlen("--sm-client-id") + 1;
- vals[i+3].value = ob_sm_id;
- vals[i+3].length = strlen(ob_sm_id) + 1;
+ vals[i+2].value = g_strdup("--sm-save-file");
+ vals[i+2].length = strlen("--sm-save-file") + 1;
+ vals[i+3].value = ob_sm_save_file;
+ vals[i+3].length = strlen(ob_sm_save_file) + 1;
+ ob_debug_type(OB_DEBUG_SM, " %s\n", vals[i+2].value);
+ ob_debug_type(OB_DEBUG_SM, " %s\n", vals[i+3].value);
- SmProp *list = ∝
SmcSetProperties(sm_conn, 1, &list);
g_free(prop.name);
g_free(prop.type);