X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=openbox%2Fsession.c;h=3cf8fbe246171f6eb720722f599202150db8489d;hb=c70379fa8f771e499a4d47e84af06d71838b780d;hp=3822d41483b688662cb9b445a657ac83fc016710;hpb=0ffd1ccc4701a9814e6ee570461b1250dd16f1e3;p=chaz%2Fopenbox diff --git a/openbox/session.c b/openbox/session.c index 3822d414..3cf8fbe2 100644 --- a/openbox/session.c +++ b/openbox/session.c @@ -33,6 +33,7 @@ GSList *session_desktop_names = NULL; 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) {} #else #include "debug.h" @@ -104,7 +105,7 @@ void session_startup(gint argc, gchar **argv) obt_paths_unref(p), p = NULL; if (!obt_paths_mkdir_path(dir, 0700)) { - g_message(_("Unable to make directory '%s': %s"), + g_message(_("Unable to make directory \"%s\": %s"), dir, g_strerror(errno)); } @@ -452,7 +453,7 @@ static gboolean session_save_to_file(const ObSMSaveData *savedata) f = fopen(ob_sm_save_file, "w"); if (!f) { success = FALSE; - g_message(_("Unable to save the session to '%s': %s"), + g_message(_("Unable to save the session to \"%s\": %s"), ob_sm_save_file, g_strerror(errno)); } else { fprintf(f, "\n\n"); @@ -584,7 +585,7 @@ static gboolean session_save_to_file(const ObSMSaveData *savedata) if (fflush(f)) { success = FALSE; - g_message(_("Error while saving the session to '%s': %s"), + g_message(_("Error while saving the session to \"%s\": %s"), ob_sm_save_file, g_strerror(errno)); } fclose(f); @@ -813,4 +814,20 @@ static void session_load_file(const gchar *path) obt_parse_instance_unref(i); } +void session_request_logout(gboolean silent) +{ + if (sm_conn) { + SmcRequestSaveYourself(sm_conn, + SmSaveBoth, + TRUE, /* logout */ + (silent ? + SmInteractStyleNone : SmInteractStyleAny), + TRUE, /* if false, with GSM, it shows the old + logout prompt */ + TRUE); /* global */ + } + else + g_message(_("Not connected to a session manager")); +} + #endif