X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=openbox%2Fsession.c;h=758e9887bb2ad3f2d8f5378ab3f0cda47dd57c96;hb=50d662681160c309ea86268c0d05794b87b75593;hp=ea909897f3a41adec17d8cf6a7114cbdb64d9344;hpb=18141d78dab9e19161cae3e7e89f8b95591a2e9b;p=chaz%2Fopenbox
diff --git a/openbox/session.c b/openbox/session.c
index ea909897..758e9887 100644
--- a/openbox/session.c
+++ b/openbox/session.c
@@ -34,6 +34,7 @@ void session_startup(gint argc, gchar **argv) {}
void session_shutdown(gboolean permanent) {}
GList* session_state_find(struct _ObClient *c) { return NULL; }
void session_request_logout(gboolean silent) {}
+gboolean session_connected(void) { return FALSE; }
#else
#include "debug.h"
@@ -159,6 +160,11 @@ void session_shutdown(gboolean permanent)
}
}
+gboolean session_connected(void)
+{
+ return !!sm_conn;
+}
+
/*! Connect to the session manager and set up our callback functions */
static gboolean session_connect(void)
{
@@ -401,7 +407,6 @@ static void sm_save_yourself_2(SmcConn conn, SmPointer data)
SmcSaveYourselfDone(conn, success);
}
-
static void sm_save_yourself(SmcConn conn, SmPointer data, gint save_type,
Bool shutdown, gint interact_style, Bool fast)
{
@@ -414,7 +419,7 @@ static void sm_save_yourself(SmcConn conn, SmPointer data, gint save_type,
(save_type == SmSaveLocal ? "SmSaveLocal" :
(save_type == SmSaveGlobal ? "SmSaveGlobal" :
(save_type == SmSaveBoth ? "SmSaveBoth" : "INVALID!!")));
- ob_debug_type(OB_DEBUG_SM, "Session save requested, type %s\n", sname);
+ ob_debug_type(OB_DEBUG_SM, "Session save requested, type %s", sname);
}
#endif
@@ -491,10 +496,14 @@ static gboolean session_save_to_file(const ObSMSaveData *savedata)
if (screen_desktop_names) {
gint i;
+ gchar *t;
fprintf(f, "\n");
- for (i = 0; screen_desktop_names[i]; ++i)
- fprintf(f, " %s\n", screen_desktop_names[i]);
+ for (i = 0; screen_desktop_names[i]; ++i){
+ t = g_markup_escape_text(screen_desktop_names[i], -1);
+ fprintf(f, " %s\n", t);
+ g_free(t);
+ }
fprintf(f, "\n");
}
@@ -549,8 +558,11 @@ static gboolean session_save_to_file(const ObSMSaveData *savedata)
if (c->sm_client_id)
fprintf(f, "\n", c->sm_client_id);
- else
- fprintf(f, "\n", c->wm_command);
+ else {
+ t = g_markup_escape_text(c->wm_command, -1);
+ fprintf(f, "\n", t);
+ g_free(t);
+ }
t = g_markup_escape_text(c->name, -1);
fprintf(f, "\t%s\n", t);