make the SessionLogout action always available but it shows an error if you use it and Openbox wasn't built with SM support
This commit is contained in:
parent
6005365133
commit
ffaac4a650
1 changed files with 6 additions and 7 deletions
|
@ -3,10 +3,6 @@
|
||||||
#include "openbox/session.h"
|
#include "openbox/session.h"
|
||||||
#include "gettext.h"
|
#include "gettext.h"
|
||||||
|
|
||||||
#ifndef USE_SM
|
|
||||||
void action_logout_startup(void) {}
|
|
||||||
#else
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
gboolean prompt;
|
gboolean prompt;
|
||||||
gboolean silent;
|
gboolean silent;
|
||||||
|
@ -38,8 +34,13 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node)
|
||||||
static void prompt_cb(ObPrompt *p, gint result, gpointer data)
|
static void prompt_cb(ObPrompt *p, gint result, gpointer data)
|
||||||
{
|
{
|
||||||
Options *o = data;
|
Options *o = data;
|
||||||
if (result)
|
if (result) {
|
||||||
|
#ifndef USE_SM
|
||||||
session_request_logout(o->silent);
|
session_request_logout(o->silent);
|
||||||
|
#else
|
||||||
|
g_message(_("The SessionLogout actions is not available since Openbox was built without session management support"));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
g_free(o);
|
g_free(o);
|
||||||
prompt_unref(p);
|
prompt_unref(p);
|
||||||
}
|
}
|
||||||
|
@ -67,5 +68,3 @@ static gboolean logout_func(ObActionsData *data, gpointer options)
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
Loading…
Reference in a new issue