|
|
f3033d |
From 53cc0f3f6846a2a27887f33ee37a713c3a6f8014 Mon Sep 17 00:00:00 2001
|
|
|
f3033d |
From: Ray Strode <rstrode@redhat.com>
|
|
|
f3033d |
Date: Wed, 3 Apr 2013 10:28:09 -0400
|
|
|
f3033d |
Subject: [PATCH] session: default to gnome-classic session
|
|
|
f3033d |
|
|
|
f3033d |
---
|
|
|
f3033d |
daemon/gdm-session.c | 8 ++++++++
|
|
|
f3033d |
1 file changed, 8 insertions(+)
|
|
|
f3033d |
|
|
|
f3033d |
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
|
|
|
f3033d |
index 87bf74f..0430929 100644
|
|
|
f3033d |
--- a/daemon/gdm-session.c
|
|
|
f3033d |
+++ b/daemon/gdm-session.c
|
|
|
f3033d |
@@ -494,60 +494,68 @@ get_session_command_for_name (const char *name,
|
|
|
f3033d |
|
|
|
f3033d |
return res;
|
|
|
f3033d |
}
|
|
|
f3033d |
|
|
|
f3033d |
static const char *
|
|
|
f3033d |
get_default_language_name (GdmSession *self)
|
|
|
f3033d |
{
|
|
|
f3033d |
if (self->priv->saved_language != NULL) {
|
|
|
f3033d |
return self->priv->saved_language;
|
|
|
f3033d |
}
|
|
|
f3033d |
|
|
|
f3033d |
return setlocale (LC_MESSAGES, NULL);
|
|
|
f3033d |
}
|
|
|
f3033d |
|
|
|
f3033d |
static const char *
|
|
|
f3033d |
get_fallback_session_name (GdmSession *self)
|
|
|
f3033d |
{
|
|
|
f3033d |
const char **search_dirs;
|
|
|
f3033d |
int i;
|
|
|
f3033d |
char *name;
|
|
|
f3033d |
GSequence *sessions;
|
|
|
f3033d |
GSequenceIter *session;
|
|
|
f3033d |
|
|
|
f3033d |
if (self->priv->fallback_session_name != NULL) {
|
|
|
f3033d |
/* verify that the cached version still exists */
|
|
|
f3033d |
if (get_session_command_for_name (self->priv->fallback_session_name, NULL)) {
|
|
|
f3033d |
goto out;
|
|
|
f3033d |
}
|
|
|
f3033d |
}
|
|
|
f3033d |
|
|
|
f3033d |
+ name = g_strdup ("gnome-classic");
|
|
|
f3033d |
+ if (get_session_command_for_name (name, NULL)) {
|
|
|
f3033d |
+ g_free (self->priv->fallback_session_name);
|
|
|
f3033d |
+ self->priv->fallback_session_name = name;
|
|
|
f3033d |
+ goto out;
|
|
|
f3033d |
+ }
|
|
|
f3033d |
+ g_free (name);
|
|
|
f3033d |
+
|
|
|
f3033d |
name = g_strdup ("gnome");
|
|
|
f3033d |
if (get_session_command_for_name (name, NULL)) {
|
|
|
f3033d |
g_free (self->priv->fallback_session_name);
|
|
|
f3033d |
self->priv->fallback_session_name = name;
|
|
|
f3033d |
goto out;
|
|
|
f3033d |
}
|
|
|
f3033d |
g_free (name);
|
|
|
f3033d |
|
|
|
f3033d |
sessions = g_sequence_new (g_free);
|
|
|
f3033d |
|
|
|
f3033d |
search_dirs = get_system_session_dirs ();
|
|
|
f3033d |
for (i = 0; search_dirs[i] != NULL; i++) {
|
|
|
f3033d |
GDir *dir;
|
|
|
f3033d |
const char *base_name;
|
|
|
f3033d |
|
|
|
f3033d |
dir = g_dir_open (search_dirs[i], 0, NULL);
|
|
|
f3033d |
|
|
|
f3033d |
if (dir == NULL) {
|
|
|
f3033d |
continue;
|
|
|
f3033d |
}
|
|
|
f3033d |
|
|
|
f3033d |
do {
|
|
|
f3033d |
base_name = g_dir_read_name (dir);
|
|
|
f3033d |
|
|
|
f3033d |
if (base_name == NULL) {
|
|
|
f3033d |
break;
|
|
|
f3033d |
}
|
|
|
f3033d |
|
|
|
f3033d |
if (!g_str_has_suffix (base_name, ".desktop")) {
|
|
|
f3033d |
continue;
|
|
|
f3033d |
--
|
|
|
f3033d |
1.8.1
|