summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/gdm-common.h2
-rw-r--r--daemon/gdm-session-direct.c24
-rw-r--r--gui/simple-greeter/gdm-greeter-panel.c13
3 files changed, 28 insertions, 11 deletions
diff --git a/common/gdm-common.h b/common/gdm-common.h
index 191bd70a..1983cffe 100644
--- a/common/gdm-common.h
+++ b/common/gdm-common.h
@@ -25,6 +25,8 @@
#include "gdm-common-unknown-origin.h"
+#define GDM_CUSTOM_SESSION "custom"
+
G_BEGIN_DECLS
gboolean gdm_is_version_unstable (void);
diff --git a/daemon/gdm-session-direct.c b/daemon/gdm-session-direct.c
index 7d5b5602..eb0fce61 100644
--- a/daemon/gdm-session-direct.c
+++ b/daemon/gdm-session-direct.c
@@ -583,11 +583,22 @@ get_session_command_for_name (const char *name,
char *filename;
filename = g_strdup_printf ("%s.desktop", name);
-
- command = NULL;
res = get_session_command_for_file (filename, command);
g_free (filename);
+ /*
+ * The GDM Xsession script honors "custom" as a valid session. If the
+ * session is one of these, no file is needed, then just run the
+ * command as "custom".
+ */
+ if (!res && strcmp (name, GDM_CUSTOM_SESSION) == 0) {
+ g_debug ("No custom desktop file, but accepting it anyway.");
+ if (command != NULL) {
+ *command = g_strdup (GDM_CUSTOM_SESSION);
+ }
+ res = TRUE;
+ }
+
return res;
}
@@ -1998,18 +2009,13 @@ get_session_command (GdmSessionDirect *session)
{
gboolean res;
char *command;
- char *filename;
-
- filename = g_strdup_printf ("%s.desktop", get_session_name (session));
command = NULL;
- res = get_session_command_for_file (filename, &command);
+ res = get_session_command_for_name (get_session_name (session), &command);
if (! res) {
- g_critical ("Cannot read specified session file: %s", filename);
- g_free (filename);
+ g_critical ("Cannot read specified session file: %s.desktop", session);
exit (1);
}
- g_free (filename);
return command;
}
diff --git a/gui/simple-greeter/gdm-greeter-panel.c b/gui/simple-greeter/gdm-greeter-panel.c
index b46378d1..89f2cb5a 100644
--- a/gui/simple-greeter/gdm-greeter-panel.c
+++ b/gui/simple-greeter/gdm-greeter-panel.c
@@ -53,6 +53,7 @@
#include "gdm-session-option-widget.h"
#include "gdm-timer.h"
#include "gdm-profile.h"
+#include "gdm-common.h"
#include "na-tray.h"
@@ -1120,8 +1121,16 @@ gdm_greeter_panel_set_default_session_name (GdmGreeterPanel *panel,
if (session_name != NULL &&
!gdm_option_widget_lookup_item (GDM_OPTION_WIDGET (panel->priv->session_option_widget),
session_name, NULL, NULL, NULL)) {
- g_warning ("Default session is not available");
- return;
+ if (strcmp (session_name, GDM_CUSTOM_SESSION) == 0) {
+ gdm_option_widget_add_item (GDM_OPTION_WIDGET (panel->priv->session_option_widget),
+ GDM_CUSTOM_SESSION,
+ C_("customsession", "Custom"),
+ _("Custom session"),
+ GDM_OPTION_WIDGET_POSITION_TOP);
+ } else {
+ g_warning ("Default session is not available");
+ return;
+ }
}
gdm_option_widget_set_default_item (GDM_OPTION_WIDGET (panel->priv->session_option_widget),