X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=openbox%2Fsession.c;h=db62589ad9dfa7beabab7e6abd1ffa069d7972ca;hb=7b57ef12963a298c731d0ef4a67de9c985ac9ba4;hp=3cf8fbe246171f6eb720722f599202150db8489d;hpb=7fb107cd37a09787c5cfa590688944b3bcb2bab8;p=chaz%2Fopenbox diff --git a/openbox/session.c b/openbox/session.c index 3cf8fbe2..db62589a 100644 --- a/openbox/session.c +++ b/openbox/session.c @@ -401,14 +401,28 @@ 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) { ObSMSaveData *savedata = NULL; gchar *vendor; - ob_debug_type(OB_DEBUG_SM, "Session save requested"); +#ifdef DEBUG + { + const gchar *sname = + (save_type == SmSaveLocal ? "SmSaveLocal" : + (save_type == SmSaveGlobal ? "SmSaveGlobal" : + (save_type == SmSaveBoth ? "SmSaveBoth" : "INVALID!!"))); + ob_debug_type(OB_DEBUG_SM, "Session save requested, type %s", sname); + } +#endif + + if (save_type == SmSaveGlobal) { + /* we have no data to save. we only store state to get back to where + we were, we don't keep open writable files or anything */ + SmcSaveYourselfDone(conn, TRUE); + return; + } vendor = SmcVendor(sm_conn); ob_debug_type(OB_DEBUG_SM, "Session manager's vendor: %s", vendor); @@ -664,6 +678,7 @@ static void session_load_file(const gchar *path) i = obt_parse_instance_new(); if (!obt_parse_load_file(i, path, "openbox_session")) { + ob_debug_type(OB_DEBUG_SM, "ERROR: session file is missing root node"); obt_parse_instance_unref(i); return; } @@ -697,6 +712,7 @@ static void session_load_file(const gchar *path) } } + ob_debug_type(OB_DEBUG_SM, "loading windows"); for (node = obt_parse_find_node(node->children, "window"); node != NULL; node = obt_parse_find_node(node->next, "window")) { @@ -761,9 +777,11 @@ static void session_load_file(const gchar *path) /* save this. they are in the file in stacking order, so preserve that order here */ session_saved_state = g_list_append(session_saved_state, state); + ob_debug_type(OB_DEBUG_SM, "loaded %s", state->name); continue; session_load_bail: + ob_debug_type(OB_DEBUG_SM, "loading FAILED"); session_state_free(state); } @@ -798,6 +816,7 @@ static void session_load_file(const gchar *path) !strcmp(s1->class, s2->class) && !strcmp(s1->role, s2->role)) { + ob_debug_type(OB_DEBUG_SM, "removing duplicate %s", s2->name); session_state_free(s2); session_saved_state = g_list_delete_link(session_saved_state, jt); @@ -806,6 +825,7 @@ static void session_load_file(const gchar *path) } if (founddup) { + ob_debug_type(OB_DEBUG_SM, "removing duplicate %s", s1->name); session_state_free(s1); session_saved_state = g_list_delete_link(session_saved_state, it); } @@ -818,7 +838,7 @@ void session_request_logout(gboolean silent) { if (sm_conn) { SmcRequestSaveYourself(sm_conn, - SmSaveBoth, + SmSaveGlobal, TRUE, /* logout */ (silent ? SmInteractStyleNone : SmInteractStyleAny),