--- gdm-2.28.1/data/gdm.conf-custom.in-orig	2009-11-05 15:03:19.305317115 -0600
+++ gdm-2.28.1/data/gdm.conf-custom.in	2009-11-05 15:03:58.878025264 -0600
@@ -10,3 +10,5 @@
 
 [chooser]
 
+[debug]
+
--- gdm-2.28.1/data/gdm.schemas.in.in-orig	2009-11-05 11:37:57.756002467 -0600
+++ gdm-2.28.1/data/gdm.schemas.in.in	2009-11-05 11:38:18.409412881 -0600
@@ -49,6 +49,12 @@
     </schema>
 
     <schema>
+      <key>debug/Enable</key>
+      <signature>b</signature>
+      <default>false</default>
+    </schema>
+
+    <schema>
       <key>security/DisallowTCP</key>
       <signature>b</signature>
       <default>false</default>
--- gdm-2.28.1/common/gdm-settings-keys.h-orig	2009-11-05 11:37:10.485381858 -0600
+++ gdm-2.28.1/common/gdm-settings-keys.h	2009-11-05 11:37:31.554884629 -0600
@@ -33,6 +33,8 @@ G_BEGIN_DECLS
 #define GDM_KEY_TIMED_LOGIN_USER "daemon/TimedLogin"
 #define GDM_KEY_TIMED_LOGIN_DELAY "daemon/TimedLoginDelay"
 
+#define GDM_KEY_DEBUG "debug/Enable"
+
 #define GDM_KEY_INCLUDE "greeter/Include"
 #define GDM_KEY_EXCLUDE "greeter/Exclude"
 #define GDM_KEY_INCLUDE_ALL "greeter/IncludeAll"
--- gdm-2.28.1/daemon/xdmcp-chooser-slave-main.c-orig	2009-11-05 14:31:04.745203362 -0600
+++ gdm-2.28.1/daemon/xdmcp-chooser-slave-main.c	2009-11-05 14:50:03.693151391 -0600
@@ -43,8 +43,10 @@
 #include "gdm-log.h"
 #include "gdm-common.h"
 #include "gdm-xdmcp-chooser-slave.h"
+
 #include "gdm-settings.h"
 #include "gdm-settings-direct.h"
+#include "gdm-settings-keys.h"
 
 static GdmSettings     *settings        = NULL;
 static int              gdm_return_code = 0;
@@ -154,14 +156,17 @@ on_slave_stopped (GdmSlave   *slave,
 }
 
 static gboolean
-is_debug_set (gboolean arg)
+is_debug_set (void)
 {
+        gboolean debug = FALSE;
+
         /* enable debugging for unstable builds */
         if (gdm_is_version_unstable ()) {
                 return TRUE;
         }
 
-        return arg;
+        gdm_settings_direct_get_boolean (GDM_KEY_DEBUG, &debug);
+        return debug;
 }
 
 int
@@ -173,10 +178,8 @@ main (int    argc,
         DBusGConnection  *connection;
         GdmSlave         *slave;
         static char      *display_id = NULL;
-        static gboolean   debug      = FALSE;
         GdmSignalHandler *signal_handler;
         static GOptionEntry entries []   = {
-                { "debug", 0, 0, G_OPTION_ARG_NONE, &debug, N_("Enable debugging code"), NULL },
                 { "display-id", 0, 0, G_OPTION_ARG_STRING, &display_id, N_("Display ID"), N_("id") },
                 { NULL }
         };
@@ -213,7 +216,7 @@ main (int    argc,
                 goto out;
         }
 
-        gdm_log_set_debug (is_debug_set (debug));
+        gdm_log_set_debug (is_debug_set ());
 
         if (display_id == NULL) {
                 g_critical ("No display ID set");
--- gdm-2.28.1/daemon/simple-slave-main.c-orig	2009-11-05 14:30:53.599292611 -0600
+++ gdm-2.28.1/daemon/simple-slave-main.c	2009-11-05 15:02:24.892018079 -0600
@@ -46,7 +46,9 @@
 #include "gdm-settings.h"
 #include "gdm-settings-direct.h"
 
-#include "gdm-settings-client.h"
+#include "gdm-settings.h"
+#include "gdm-settings-direct.h"
+#include "gdm-settings-keys.h"
 
 static GdmSettings     *settings        = NULL;
 static int              gdm_return_code = 0;
@@ -154,14 +156,17 @@ on_slave_stopped (GdmSlave   *slave,
 }
 
 static gboolean
-is_debug_set (gboolean arg)
+is_debug_set (void)
 {
+        gboolean debug = FALSE;
+
         /* enable debugging for unstable builds */
         if (gdm_is_version_unstable ()) {
                 return TRUE;
         }
 
-        return arg;
+        gdm_settings_direct_get_boolean (GDM_KEY_DEBUG, &debug);
+        return debug;
 }
 
 int
@@ -173,10 +178,8 @@ main (int    argc,
         DBusGConnection  *connection;
         GdmSlave         *slave;
         static char      *display_id = NULL;
-        static gboolean   debug      = FALSE;
         GdmSignalHandler *signal_handler;
         static GOptionEntry entries []   = {
-                { "debug", 0, 0, G_OPTION_ARG_NONE, &debug, N_("Enable debugging code"), NULL },
                 { "display-id", 0, 0, G_OPTION_ARG_STRING, &display_id, N_("Display ID"), N_("id") },
                 { NULL }
         };
@@ -216,7 +219,7 @@ main (int    argc,
                 goto out;
         }
 
-        gdm_log_set_debug (is_debug_set (debug));
+        gdm_log_set_debug (is_debug_set ());
 
         if (display_id == NULL) {
                 g_critical ("No display ID set");
--- gdm-2.28.1/daemon/factory-slave-main.c-orig	2009-11-05 14:30:16.184563643 -0600
+++ gdm-2.28.1/daemon/factory-slave-main.c	2009-11-05 14:43:10.189655091 -0600
@@ -44,7 +44,12 @@
 #include "gdm-common.h"
 #include "gdm-factory-slave.h"
 
-static int gdm_return_code = 0;
+#include "gdm-settings.h"
+#include "gdm-settings-direct.h"
+#include "gdm-settings-keys.h"
+
+static GdmSettings     *settings        = NULL;
+static int              gdm_return_code = 0;
 
 static DBusGConnection *
 get_system_bus (void)
@@ -145,14 +150,17 @@ on_slave_stopped (GdmSlave   *slave,
 }
 
 static gboolean
-is_debug_set (gboolean arg)
+is_debug_set (void)
 {
+        gboolean debug = FALSE;
+
         /* enable debugging for unstable builds */
         if (gdm_is_version_unstable ()) {
                 return TRUE;
         }
 
-        return arg;
+        gdm_settings_direct_get_boolean (GDM_KEY_DEBUG, &debug);
+        return debug;
 }
 
 int
@@ -164,10 +172,8 @@ main (int    argc,
         DBusGConnection  *connection;
         GdmSlave         *slave;
         static char      *display_id = NULL;
-        static gboolean   debug      = FALSE;
         GdmSignalHandler *signal_handler;
         static GOptionEntry entries []   = {
-                { "debug", 0, 0, G_OPTION_ARG_NONE, &debug, N_("Enable debugging code"), NULL },
                 { "display-id", 0, 0, G_OPTION_ARG_STRING, &display_id, N_("Display ID"), N_("id") },
                 { NULL }
         };
@@ -193,7 +199,18 @@ main (int    argc,
 
         gdm_log_init ();
 
-        gdm_log_set_debug (is_debug_set (debug));
+        settings = gdm_settings_new ();
+        if (settings == NULL) {
+                g_warning ("Unable to initialize settings");
+                exit (1);
+        }
+
+        if (! gdm_settings_direct_init (settings, GDMCONFDIR "/gdm.schemas", "/")) {
+                g_warning ("Unable to initialize settings");
+                exit (1);
+        }
+
+        gdm_log_set_debug (is_debug_set ());
 
         if (display_id == NULL) {
                 g_critical ("No display ID set");
--- gdm-2.28.1/daemon/main.c-orig	2009-11-05 11:38:54.361524309 -0600
+++ gdm-2.28.1/daemon/main.c	2009-11-05 14:39:06.850523343 -0600
@@ -499,6 +499,20 @@ signal_cb (int      signo,
         return ret;
 }
 
+static gboolean
+is_debug_set (void)
+{
+        gboolean debug = FALSE;
+
+        /* enable debugging for unstable builds */
+        if (gdm_is_version_unstable ()) {
+                return TRUE;
+        }
+
+        gdm_settings_direct_get_boolean (GDM_KEY_DEBUG, &debug);
+        return debug;
+}
+
 int
 main (int    argc,
       char **argv)
@@ -512,12 +526,10 @@ main (int    argc,
         gboolean            res;
         gboolean            xdmcp_enabled;
         GdmSignalHandler   *signal_handler;
-        static gboolean     debug            = FALSE;
         static gboolean     do_timed_exit    = FALSE;
         static gboolean     print_version    = FALSE;
         static gboolean     fatal_warnings   = FALSE;
         static GOptionEntry entries []   = {
-                { "debug", 0, 0, G_OPTION_ARG_NONE, &debug, N_("Enable debugging code"), NULL },
                 { "fatal-warnings", 0, 0, G_OPTION_ARG_NONE, &fatal_warnings, N_("Make all warnings fatal"), NULL },
                 { "timed-exit", 0, 0, G_OPTION_ARG_NONE, &do_timed_exit, N_("Exit after a time - for debugging"), NULL },
                 { "version", 0, 0, G_OPTION_ARG_NONE, &print_version, N_("Print GDM version"), NULL },
@@ -600,7 +612,7 @@ main (int    argc,
                 goto out;
         }
 
-        gdm_log_set_debug (debug);
+        gdm_log_set_debug (is_debug_set ());
 
         gdm_daemon_change_user (&gdm_uid, &gdm_gid);
         gdm_daemon_check_permissions (gdm_uid, gdm_gid);
--- gdm-2.28.1/daemon/session-worker-main.c-orig	2009-11-05 14:32:45.011829051 -0600
+++ gdm-2.28.1/daemon/session-worker-main.c	2009-11-05 14:46:29.279779375 -0600
@@ -44,9 +44,15 @@
 #include "gdm-log.h"
 #include "gdm-session-worker.h"
 
+#include "gdm-settings.h"
+#include "gdm-settings-direct.h"
+#include "gdm-settings-keys.h"
+
 #define SERVER_DBUS_PATH      "/org/gnome/DisplayManager/SessionServer"
 #define SERVER_DBUS_INTERFACE "org.gnome.DisplayManager.SessionServer"
 
+static GdmSettings *settings = NULL;
+
 static gboolean
 signal_cb (int      signo,
            gpointer data)
@@ -113,14 +119,17 @@ signal_cb (int      signo,
 }
 
 static gboolean
-is_debug_set (gboolean arg)
+is_debug_set (void)
 {
+        gboolean debug = FALSE;
+
         /* enable debugging for unstable builds */
         if (gdm_is_version_unstable ()) {
                 return TRUE;
         }
 
-        return arg;
+        gdm_settings_direct_get_boolean (GDM_KEY_DEBUG, &debug);
+        return debug;
 }
 
 int
@@ -132,9 +141,7 @@ main (int    argc,
         GdmSessionWorker *worker;
         GdmSignalHandler *signal_handler;
         const char       *address;
-        static gboolean   debug      = FALSE;
         static GOptionEntry entries []   = {
-                { "debug", 0, 0, G_OPTION_ARG_NONE, &debug, N_("Enable debugging code"), NULL },
                 { NULL }
         };
 
@@ -153,7 +160,19 @@ main (int    argc,
         g_option_context_free (context);
 
         gdm_log_init ();
-        gdm_log_set_debug (is_debug_set (debug));
+
+        settings = gdm_settings_new ();
+        if (settings == NULL) {
+                g_warning ("Unable to initialize settings");
+                exit (1);
+        }
+
+        if (! gdm_settings_direct_init (settings, GDMCONFDIR "/gdm.schemas", "/")) {
+                g_warning ("Unable to initialize settings");
+                exit (1);
+        }
+
+        gdm_log_set_debug (is_debug_set ());
 
         address = g_getenv ("GDM_SESSION_DBUS_ADDRESS");
         if (address == NULL) {
--- gdm-2.28.1/daemon/product-slave-main.c-orig	2009-11-05 14:30:31.230612818 -0600
+++ gdm-2.28.1/daemon/product-slave-main.c	2009-11-05 14:46:03.248764645 -0600
@@ -44,7 +44,12 @@
 #include "gdm-common.h"
 #include "gdm-product-slave.h"
 
-static int gdm_return_code = 0;
+#include "gdm-settings.h"
+#include "gdm-settings-direct.h"
+#include "gdm-settings-keys.h"
+
+static GdmSettings     *settings        = NULL;
+static int              gdm_return_code = 0;
 
 static DBusGConnection *
 get_system_bus (void)
@@ -149,14 +154,17 @@ on_slave_stopped (GdmSlave   *slave,
 }
 
 static gboolean
-is_debug_set (gboolean arg)
+is_debug_set (void)
 {
+        gboolean debug = FALSE;
+
         /* enable debugging for unstable builds */
         if (gdm_is_version_unstable ()) {
                 return TRUE;
         }
 
-        return arg;
+        gdm_settings_direct_get_boolean (GDM_KEY_DEBUG, &debug);
+        return debug;
 }
 
 int
@@ -168,10 +176,8 @@ main (int    argc,
         DBusGConnection  *connection;
         GdmSlave         *slave;
         static char      *display_id = NULL;
-        static gboolean   debug      = FALSE;
         GdmSignalHandler *signal_handler;
         static GOptionEntry entries []   = {
-                { "debug", 0, 0, G_OPTION_ARG_NONE, &debug, N_("Enable debugging code"), NULL },
                 { "display-id", 0, 0, G_OPTION_ARG_STRING, &display_id, N_("Display ID"), N_("id") },
                 { NULL }
         };
@@ -197,7 +203,18 @@ main (int    argc,
 
         gdm_log_init ();
 
-        gdm_log_set_debug (is_debug_set (debug));
+        settings = gdm_settings_new ();
+        if (settings == NULL) {
+                g_warning ("Unable to initialize settings");
+                goto out;
+        }
+
+        if (! gdm_settings_direct_init (settings, GDMCONFDIR "/gdm.schemas", "/")) {
+                g_warning ("Unable to initialize settings");
+                goto out;
+        }
+
+        gdm_log_set_debug (is_debug_set ());
 
         if (display_id == NULL) {
                 g_critical ("No display ID set");
--- gdm-2.28.1/gui/simple-greeter/gdm-simple-greeter.schemas.in-orig	2009-11-05 15:00:22.860126085 -0600
+++ gdm-2.28.1/gui/simple-greeter/gdm-simple-greeter.schemas.in	2009-11-05 15:00:35.853264321 -0600
@@ -1,17 +1,6 @@
 <gconfschemafile>
   <schemalist>
     <schema>
-      <key>/schemas/apps/gdm/simple-greeter/debug</key>
-      <applyto>/apps/gdm/simple-greeter/debug</applyto>
-      <owner>gdm-simple-greeter</owner>
-      <type>bool</type>
-      <default>false</default>
-      <locale name="C">
-        <short>Enable debugging</short>
-        <long>Enable debugging mode for the greeter.</long>
-      </locale>
-    </schema>
-    <schema>
       <key>/schemas/apps/gdm/simple-greeter/banner_message_enable</key>
       <applyto>/apps/gdm/simple-greeter/banner_message_enable</applyto>
       <owner>gdm-simple-greeter</owner>
--- gdm-2.28.1/gui/simple-greeter/greeter-main.c-orig	2009-11-05 14:56:01.358228009 -0600
+++ gdm-2.28.1/gui/simple-greeter/greeter-main.c	2009-11-05 15:02:08.354484036 -0600
@@ -42,8 +42,6 @@
 
 #include "gdm-greeter-session.h"
 
-#define DEBUG_KEY                 "/apps/gdm/simple-greeter/debug"
-
 #define SM_DBUS_NAME      "org.gnome.SessionManager"
 #define SM_DBUS_PATH      "/org/gnome/SessionManager"
 #define SM_DBUS_INTERFACE "org.gnome.SessionManager"
@@ -58,19 +56,15 @@ static DBusGProxy      *client_proxy = N
 static gboolean
 is_debug_set (void)
 {
-        GConfClient *client;
-        gboolean     is;
+        gboolean debug = FALSE;
 
         /* enable debugging for unstable builds */
         if (gdm_is_version_unstable ()) {
                 return TRUE;
         }
 
-        client = gconf_client_get_default ();
-        is = gconf_client_get_bool (client, DEBUG_KEY, NULL);
-        g_object_unref (client);
-
-        return is;
+        gdm_settings_client_get_boolean (GDM_KEY_DEBUG, &debug);
+        return debug;
 }
 
 
