+
+ SmcSetProperties(sm_conn, 1, &list);
+ g_free(prop.name);
+ g_free(prop.type);
+ g_free(vals);
+}
+
+static void session_setup_restart_command(void)
+{
+ gint i;
+
+ SmPropValue *vals = g_new(SmPropValue, sm_argc + 4);
+ SmProp prop = {
+ .name = g_strdup(SmRestartCommand),
+ .type = g_strdup(SmLISTofARRAY8),
+ .num_vals = sm_argc + 4,
+ .vals = vals
+ };
+ SmProp *list = ∝
+
+ ob_debug_type(OB_DEBUG_SM, "Setting restart command: (%d)", 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", vals[i].value);
+ }
+
+ 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", vals[i].value);
+ ob_debug_type(OB_DEBUG_SM, " %s", vals[i+1].value);
+
+ 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", vals[i+2].value);
+ ob_debug_type(OB_DEBUG_SM, " %s", vals[i+3].value);
+
+ SmcSetProperties(sm_conn, 1, &list);
+ g_free(prop.name);
+ g_free(prop.type);
+ g_free(vals[i].value);
+ g_free(vals[i+2].value);
+ g_free(vals);
+}
+
+static ObSMSaveData *sm_save_get_data(void)
+{
+ ObSMSaveData *savedata = g_slice_new0(ObSMSaveData);
+ /* save the active desktop and client.
+ we don't bother to preemptively save the other desktop state like
+ number and names of desktops, cuz those shouldn't be changing during
+ the save.. */
+ savedata->focus_client = focus_client;
+ savedata->desktop = screen_desktop;
+ return savedata;