2011-07-28 Brian Cameron <[email protected]> gnome-2-30
authoryippi
Thu, 28 Jul 2011 03:50:58 +0000
branchgnome-2-30
changeset 22037 6bbc65b301fa
parent 22035 28d12951bffe
child 22038 9bfd1d74f1cd
2011-07-28 Brian Cameron <[email protected]> * patches/gdm-01-dynamic-display.diff: Fix GDM so that if the Xserver dies with a non-zero return code that the GDM daemon respawns the display. This is needed to make GDM work when the display is killed with Ctrl-Alt-Bksp (or Ctrl-Alt-Bksp-Bksp on Sun Ray). * patches/ConsoleKit-01-ck-dynamic.diff: Fix crashing problem caused by referencing a pointer improperly. * patches/gdm-09-lang.diff: Fix spacing.
ChangeLog
patches/ConsoleKit-01-ck-dynamic.diff
patches/gdm-01-dynamic-display.diff
patches/gdm-09-lang.diff
--- a/ChangeLog	Thu Jul 28 02:01:12 2011 +0000
+++ b/ChangeLog	Thu Jul 28 03:50:58 2011 +0000
@@ -1,3 +1,13 @@
+2011-07-28  Brian Cameron  <[email protected]>
+
+	* patches/gdm-01-dynamic-display.diff: Fix GDM so that if the Xserver
+	  dies with a non-zero return code that the GDM daemon respawns the
+	  display.  This is needed to make GDM work when the display is killed
+	  with Ctrl-Alt-Bksp (or Ctrl-Alt-Bksp-Bksp on Sun Ray).
+	* patches/ConsoleKit-01-ck-dynamic.diff: Fix crashing problem caused
+	  by referencing a pointer improperly.
+	* patches/gdm-09-lang.diff: Fix spacing.
+
 2011-07-28  Jeff Cai <[email protected]>
 
 	* patches/xscreensaver-06-gtk-lock.diff: Fix bug 7069487 and 7059702.
--- a/patches/ConsoleKit-01-ck-dynamic.diff	Thu Jul 28 02:01:12 2011 +0000
+++ b/patches/ConsoleKit-01-ck-dynamic.diff	Thu Jul 28 03:50:58 2011 +0000
@@ -1710,7 +1710,7 @@
 +        CkSeat     *seat = NULL;
 +        CkSeatKind kind;
 +
-+        g_debug ("CkManager: Remove seat '%s'.", *sid);
++        g_debug ("CkManager: Remove seat '%s'.", sid);
 +        g_return_val_if_fail (CK_IS_MANAGER (manager), FALSE);
 +
 +        seat = g_hash_table_lookup (manager->priv->seats, sid);
--- a/patches/gdm-01-dynamic-display.diff	Thu Jul 28 02:01:12 2011 +0000
+++ b/patches/gdm-01-dynamic-display.diff	Thu Jul 28 03:50:58 2011 +0000
@@ -499,7 +499,15 @@
 index abedc0b..4a94aab 100644
 --- a/daemon/gdm-display.c
 +++ b/daemon/gdm-display.c
-@@ -51,11 +51,14 @@ static guint32 display_serial = 1;
+@@ -41,6 +41,7 @@
+ #include "gdm-settings-keys.h"
+ 
+ #include "gdm-slave-proxy.h"
++#include "gdm-dynamic-display.h"
+ 
+ static guint32 display_serial = 1;
+ 
+@@ -51,11 +52,14 @@ static guint32 display_serial = 1;
  struct GdmDisplayPrivate
  {
          char                 *id;
@@ -514,7 +522,7 @@
          int                   status;
          time_t                creation_time;
          GTimer               *slave_timer;
-@@ -66,6 +69,8 @@ struct GdmDisplayPrivate
+@@ -66,6 +70,8 @@ struct GdmDisplayPrivate
          GdmDisplayAccessFile *access_file;
  
          gboolean              is_local;
@@ -523,7 +531,7 @@
          guint                 finish_idle_id;
  
          GdmSlaveProxy        *slave_proxy;
-@@ -78,13 +83,18 @@ enum {
+@@ -78,13 +84,18 @@ enum {
          PROP_ID,
          PROP_STATUS,
          PROP_SEAT_ID,
@@ -542,7 +550,7 @@
  };
  
  static void     gdm_display_class_init  (GdmDisplayClass *klass);
-@@ -489,6 +499,20 @@ gdm_display_get_seat_id (GdmDisplay *display,
+@@ -489,6 +500,20 @@ gdm_display_get_seat_id (GdmDisplay *dis
         return TRUE;
  }
  
@@ -563,7 +571,20 @@
  static gboolean
  finish_idle (GdmDisplay *display)
  {
-@@ -550,10 +574,12 @@ gdm_display_real_prepare (GdmDisplay *display)
+@@ -513,6 +538,12 @@ slave_exited (GdmSlaveProxy       *proxy
+ {
+         g_debug ("GdmDisplay: Slave exited: %d", code);
+ 
++        if (code != 0) {
++                gdm_dynamic_display_respawn (TRUE);
++        } else {
++                gdm_dynamic_display_respawn (FALSE);
++        }
++
+         queue_finish (display);
+ }
+ 
+@@ -550,10 +581,12 @@ gdm_display_real_prepare (GdmDisplay *di
  
          g_assert (display->priv->slave_proxy == NULL);
  
@@ -580,7 +601,7 @@
          }
  
          _gdm_display_set_status (display, GDM_DISPLAY_PREPARED);
-@@ -742,6 +768,20 @@ gdm_display_get_id (GdmDisplay         *display,
+@@ -742,6 +775,20 @@ gdm_display_get_id (GdmDisplay         *
  }
  
  gboolean
@@ -601,7 +622,7 @@
  gdm_display_get_x11_display_name (GdmDisplay   *display,
                                    char        **x11_display,
                                    GError      **error)
-@@ -756,6 +796,20 @@ gdm_display_get_x11_display_name (GdmDisplay   *display,
+@@ -756,6 +803,20 @@ gdm_display_get_x11_display_name (GdmDis
  }
  
  gboolean
@@ -622,7 +643,7 @@
  gdm_display_is_local (GdmDisplay *display,
                        gboolean   *local,
                        GError    **error)
-@@ -769,6 +823,20 @@ gdm_display_is_local (GdmDisplay *display,
+@@ -769,6 +830,20 @@ gdm_display_is_local (GdmDisplay *displa
          return TRUE;
  }
  
@@ -643,7 +664,7 @@
  static void
  _gdm_display_set_id (GdmDisplay     *display,
                       const char     *id)
-@@ -778,6 +846,14 @@ _gdm_display_set_id (GdmDisplay     *display,
+@@ -778,6 +853,14 @@ _gdm_display_set_id (GdmDisplay     *dis
  }
  
  static void
@@ -658,7 +679,7 @@
  _gdm_display_set_seat_id (GdmDisplay     *display,
                            const char     *seat_id)
  {
-@@ -786,6 +862,24 @@ _gdm_display_set_seat_id (GdmDisplay     *display,
+@@ -786,6 +869,24 @@ _gdm_display_set_seat_id (GdmDisplay    
  }
  
  static void
@@ -683,7 +704,7 @@
  _gdm_display_set_remote_hostname (GdmDisplay     *display,
                                    const char     *hostname)
  {
-@@ -809,6 +903,14 @@ _gdm_display_set_x11_display_name (GdmDisplay     *display,
+@@ -809,6 +910,14 @@ _gdm_display_set_x11_display_name (GdmDi
  }
  
  static void
@@ -698,7 +719,7 @@
  _gdm_display_set_x11_cookie (GdmDisplay     *display,
                               const char     *x11_cookie)
  {
-@@ -824,6 +926,13 @@ _gdm_display_set_is_local (GdmDisplay     *display,
+@@ -824,6 +933,13 @@ _gdm_display_set_is_local (GdmDisplay   
  }
  
  static void
@@ -712,7 +733,7 @@
  _gdm_display_set_slave_command (GdmDisplay     *display,
                                  const char     *command)
  {
-@@ -832,6 +941,13 @@ _gdm_display_set_slave_command (GdmDisplay     *display,
+@@ -832,6 +948,13 @@ _gdm_display_set_slave_command (GdmDispl
  }
  
  static void
@@ -726,7 +747,7 @@
  gdm_display_set_property (GObject        *object,
                            guint           prop_id,
                            const GValue   *value,
-@@ -845,12 +961,18 @@ gdm_display_set_property (GObject        *object,
+@@ -845,12 +968,18 @@ gdm_display_set_property (GObject       
          case PROP_ID:
                  _gdm_display_set_id (self, g_value_get_string (value));
                  break;
@@ -745,7 +766,7 @@
          case PROP_REMOTE_HOSTNAME:
                  _gdm_display_set_remote_hostname (self, g_value_get_string (value));
                  break;
-@@ -860,15 +982,24 @@ gdm_display_set_property (GObject        *object,
+@@ -860,15 +989,24 @@ gdm_display_set_property (GObject       
          case PROP_X11_DISPLAY_NAME:
                  _gdm_display_set_x11_display_name (self, g_value_get_string (value));
                  break;
@@ -770,7 +791,7 @@
          default:
                  G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
                  break;
-@@ -889,12 +1020,18 @@ gdm_display_get_property (GObject        *object,
+@@ -889,12 +1027,18 @@ gdm_display_get_property (GObject       
          case PROP_ID:
                  g_value_set_string (value, self->priv->id);
                  break;
@@ -789,7 +810,7 @@
          case PROP_REMOTE_HOSTNAME:
                  g_value_set_string (value, self->priv->remote_hostname);
                  break;
-@@ -904,6 +1041,9 @@ gdm_display_get_property (GObject        *object,
+@@ -904,6 +1048,9 @@ gdm_display_get_property (GObject       
          case PROP_X11_DISPLAY_NAME:
                  g_value_set_string (value, self->priv->x11_display_name);
                  break;
@@ -799,7 +820,7 @@
          case PROP_X11_COOKIE:
                  g_value_set_string (value, self->priv->x11_cookie);
                  break;
-@@ -914,9 +1054,15 @@ gdm_display_get_property (GObject        *object,
+@@ -914,9 +1061,15 @@ gdm_display_get_property (GObject       
          case PROP_IS_LOCAL:
                  g_value_set_boolean (value, self->priv->is_local);
                  break;
@@ -815,7 +836,7 @@
          default:
                  G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
                  break;
-@@ -1033,6 +1179,13 @@ gdm_display_class_init (GdmDisplayClass *klass)
+@@ -1033,6 +1186,13 @@ gdm_display_class_init (GdmDisplayClass 
                                                                NULL,
                                                                G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
          g_object_class_install_property (object_class,
@@ -829,7 +850,7 @@
                                           PROP_REMOTE_HOSTNAME,
                                           g_param_spec_string ("remote-hostname",
                                                                "remote-hostname",
-@@ -1056,6 +1209,13 @@ gdm_display_class_init (GdmDisplayClass *klass)
+@@ -1056,6 +1216,13 @@ gdm_display_class_init (GdmDisplayClass 
                                                                NULL,
                                                                G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
          g_object_class_install_property (object_class,
@@ -843,7 +864,7 @@
                                           PROP_SEAT_ID,
                                           g_param_spec_string ("seat-id",
                                                                "seat id",
-@@ -1063,6 +1223,13 @@ gdm_display_class_init (GdmDisplayClass *klass)
+@@ -1063,6 +1230,13 @@ gdm_display_class_init (GdmDisplayClass 
                                                                NULL,
                                                                G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
          g_object_class_install_property (object_class,
@@ -857,7 +878,7 @@
                                           PROP_X11_COOKIE,
                                           g_param_spec_string ("x11-cookie",
                                                                "cookie",
-@@ -1076,7 +1243,6 @@ gdm_display_class_init (GdmDisplayClass *klass)
+@@ -1076,7 +1250,6 @@ gdm_display_class_init (GdmDisplayClass 
                                                                "authority file",
                                                                NULL,
                                                                G_PARAM_READABLE));
@@ -865,7 +886,7 @@
          g_object_class_install_property (object_class,
                                           PROP_IS_LOCAL,
                                           g_param_spec_boolean ("is-local",
-@@ -1084,7 +1250,13 @@ gdm_display_class_init (GdmDisplayClass *klass)
+@@ -1084,7 +1257,13 @@ gdm_display_class_init (GdmDisplayClass 
                                                                 NULL,
                                                                 TRUE,
                                                                 G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
@@ -880,7 +901,7 @@
          g_object_class_install_property (object_class,
                                           PROP_SLAVE_COMMAND,
                                           g_param_spec_string ("slave-command",
-@@ -1093,6 +1265,13 @@ gdm_display_class_init (GdmDisplayClass *klass)
+@@ -1093,6 +1272,13 @@ gdm_display_class_init (GdmDisplayClass 
                                                                DEFAULT_SLAVE_COMMAND,
                                                                G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
          g_object_class_install_property (object_class,
@@ -894,7 +915,7 @@
                                           PROP_STATUS,
                                           g_param_spec_int ("status",
                                                             "status",
-@@ -1131,9 +1310,12 @@ gdm_display_finalize (GObject *object)
+@@ -1131,9 +1317,12 @@ gdm_display_finalize (GObject *object)
  
          g_debug ("GdmDisplay: Finalizing display: %s", display->priv->id);
          g_free (display->priv->id);
@@ -907,7 +928,7 @@
          g_free (display->priv->x11_cookie);
          g_free (display->priv->slave_command);
  
-@@ -1151,3 +1333,25 @@ gdm_display_finalize (GObject *object)
+@@ -1151,3 +1340,25 @@ gdm_display_finalize (GObject *object)
  
          G_OBJECT_CLASS (gdm_display_parent_class)->finalize (object);
  }
@@ -1055,7 +1076,7 @@
 index 0000000..c0beced
 --- /dev/null
 +++ b/daemon/gdm-dynamic-display.c
-@@ -0,0 +1,215 @@
+@@ -0,0 +1,234 @@
 +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
 + *
 + * Authors: [email protected]
@@ -1116,6 +1137,17 @@
 +
 +G_DEFINE_TYPE (GdmDynamicDisplay, gdm_dynamic_display, GDM_TYPE_DISPLAY)
 +
++static gboolean do_respawn = FALSE;
++
++void gdm_dynamic_display_respawn (gboolean respawn)
++{
++        do_respawn = respawn;
++        if (do_respawn == TRUE)
++                g_debug ("GdmDynamicDisplay: Set respawn to TRUE.");
++        else
++                g_debug ("GdmDynamicDisplay: Set respawn to FALSE.");
++}
++
 +static gboolean
 +gdm_dynamic_display_create_authority (GdmDisplay *display)
 +{
@@ -1150,6 +1182,8 @@
 +
 +        g_debug ("GdmDynamicDisplay: Manage dynamic display");
 +
++        do_respawn = FALSE;
++
 +        GDM_DISPLAY_CLASS (gdm_dynamic_display_parent_class)->manage (display);
 +
 +        return TRUE;
@@ -1158,19 +1192,25 @@
 +static gboolean
 +gdm_dynamic_display_finish (GdmDisplay *display)
 +{
-+  int status;
-+
-+  g_return_val_if_fail (GDM_IS_DISPLAY (display), FALSE);
-+
-+  g_debug ("GdmDynamicDisplay: Finish dynamic display");
-+
-+  /* Don't call parent's finish since we don't ever
-+  want to be put in the FINISHED state */
-+
-+  /* restart dynamic displays */
-+  gdm_display_unmanage (display);
-+
-+  return TRUE;
++        int status;
++
++        g_return_val_if_fail (GDM_IS_DISPLAY (display), FALSE);
++
++        g_debug ("GdmDynamicDisplay: Finish dynamic display");
++
++        /* Don't call parent's finish since we don't ever
++        want to be put in the FINISHED state */
++
++        /* restart dynamic displays */
++        gdm_display_unmanage (display);
++
++        status = gdm_display_get_status (display);
++        if (do_respawn == TRUE) {
++                g_debug ("Respawning...");
++                gdm_display_manage (display);
++        }
++
++        return TRUE;
 +}
 +
 +static gboolean
@@ -1331,7 +1371,7 @@
 +
 +GType               gdm_dynamic_display_get_type                (void);
 +GdmDisplay *        gdm_dynamic_display_new                     (int display_number);
-+
++void                gdm_dynamic_display_respawn                 (gboolean respawn);
 +
 +G_END_DECLS
 +
@@ -3417,22 +3457,11 @@
                  worker->priv->x11_authority_file = g_strdup (x11_authority_file);
                  worker->priv->display_device = g_strdup (console);
                  worker->priv->hostname = g_strdup (hostname);
-@@ -2892,6 +2932,10 @@ worker_dbus_filter_function (DBusConnect
- 
-                 g_debug ("GdmSessionWorker: Got disconnected from the server");
- 
-+                ck_connector_set_remove_on_close (worker->priv->ckc,
-+                                                  TRUE,
-+                                                  NULL);
-+
-                 dbus_connection_unref (connection);
-                 worker->priv->connection = NULL;
- 
 diff --git a/daemon/gdm-simple-slave.c b/daemon/gdm-simple-slave.c
 index fb14223..682982a 100644
 --- a/daemon/gdm-simple-slave.c
 +++ b/daemon/gdm-simple-slave.c
-@@ -392,6 +392,10 @@ start_session_timeout (GdmSimpleSlave *slave)
+@@ -385,6 +385,10 @@ start_session_timeout (GdmSimpleSlave *s
                  goto out;
          }
  
@@ -3443,7 +3472,7 @@
          stop_greeter (slave);
  
          auth_file = NULL;
-@@ -406,6 +410,7 @@ start_session_timeout (GdmSimpleSlave *slave)
+@@ -399,6 +403,7 @@ start_session_timeout (GdmSimpleSlave *s
          g_free (auth_file);
  
          gdm_session_start_session (GDM_SESSION (slave->priv->session));
@@ -3451,7 +3480,7 @@
   out:
          slave->priv->start_session_id = 0;
          return FALSE;
-@@ -607,6 +612,16 @@ on_default_session_name_changed (GdmSession     *session,
+@@ -600,6 +605,16 @@ on_default_session_name_changed (GdmSess
  }
  
  static void
@@ -3468,7 +3497,7 @@
  create_new_session (GdmSimpleSlave *slave)
  {
          gboolean       display_is_local;
-@@ -641,6 +656,7 @@ create_new_session (GdmSimpleSlave *slave)
+@@ -634,6 +649,7 @@ create_new_session (GdmSimpleSlave *slav
          g_free (display_name);
          g_free (display_device);
          g_free (display_hostname);
@@ -3476,7 +3505,7 @@
  
          g_signal_connect (slave->priv->session,
                            "conversation-started",
-@@ -747,6 +763,11 @@ create_new_session (GdmSimpleSlave *slave)
+@@ -740,6 +756,11 @@ create_new_session (GdmSimpleSlave *slav
                            "default-session-name-changed",
                            G_CALLBACK (on_default_session_name_changed),
                            slave);
@@ -3488,7 +3517,16 @@
  }
  
  static void
-@@ -914,6 +935,8 @@ start_greeter (GdmSimpleSlave *slave)
+@@ -763,7 +784,7 @@ on_greeter_session_exited (GdmGreeterSes
+                            GdmSimpleSlave       *slave)
+ {
+         g_debug ("GdmSimpleSlave: Greeter exited: %d", code);
+-        gdm_slave_stopped (GDM_SLAVE (slave));
++        gdm_slave_failed (GDM_SLAVE (slave));
+ }
+ 
+ static void
+@@ -907,6 +928,8 @@ start_greeter (GdmSimpleSlave *slave)
          gboolean       display_is_local;
          char          *display_id;
          char          *display_name;
@@ -3497,7 +3535,7 @@
          char          *display_device;
          char          *display_hostname;
          char          *auth_file;
-@@ -925,6 +948,8 @@ start_greeter (GdmSimpleSlave *slave)
+@@ -918,6 +941,8 @@ start_greeter (GdmSimpleSlave *slave)
          display_is_local = FALSE;
          display_id = NULL;
          display_name = NULL;
@@ -3506,7 +3544,7 @@
          auth_file = NULL;
          display_device = NULL;
          display_hostname = NULL;
-@@ -933,6 +958,8 @@ start_greeter (GdmSimpleSlave *slave)
+@@ -926,6 +951,8 @@ start_greeter (GdmSimpleSlave *slave)
                        "display-id", &display_id,
                        "display-is-local", &display_is_local,
                        "display-name", &display_name,
@@ -3515,7 +3553,7 @@
                        "display-hostname", &display_hostname,
                        "display-x11-authority-file", &auth_file,
                        NULL);
-@@ -1012,6 +1039,8 @@ start_greeter (GdmSimpleSlave *slave)
+@@ -1005,6 +1032,8 @@ start_greeter (GdmSimpleSlave *slave)
  
          g_debug ("GdmSimpleSlave: Creating greeter on %s %s %s", display_name, display_device, display_hostname);
          slave->priv->greeter = gdm_greeter_session_new (display_name,
@@ -3524,7 +3562,7 @@
                                                          display_device,
                                                          display_hostname,
                                                          display_is_local);
-@@ -1042,6 +1071,7 @@ start_greeter (GdmSimpleSlave *slave)
+@@ -1035,6 +1064,7 @@ start_greeter (GdmSimpleSlave *slave)
  
          g_free (display_id);
          g_free (display_name);
@@ -3532,7 +3570,20 @@
          g_free (display_device);
          g_free (display_hostname);
          g_free (auth_file);
-@@ -1117,31 +1147,20 @@ on_server_died (GdmServer      *server,
+@@ -1092,7 +1122,11 @@ on_server_exited (GdmServer      *server
+ {
+         g_debug ("GdmSimpleSlave: server exited with code %d\n", exit_code);
+ 
+-        gdm_slave_stopped (GDM_SLAVE (slave));
++        if (exit_code != 0) {
++                gdm_slave_failed (GDM_SLAVE (slave));
++        } else {
++                gdm_slave_stopped (GDM_SLAVE (slave));
++        }
+ }
+ 
+ static void
+@@ -1110,31 +1144,20 @@ on_server_died (GdmServer      *server,
  static gboolean
  gdm_simple_slave_run (GdmSimpleSlave *slave)
  {
@@ -3567,7 +3618,7 @@
  
                  g_signal_connect (slave->priv->server,
                                    "exited",
-@@ -1174,8 +1193,7 @@ gdm_simple_slave_run (GdmSimpleSlave *slave)
+@@ -1167,8 +1190,7 @@ gdm_simple_slave_run (GdmSimpleSlave *sl
                  g_timeout_add (500, (GSourceFunc)idle_connect_to_display, slave);
          }
  
@@ -3595,7 +3646,7 @@
          char            *display_x11_authority_file;
          char            *parent_display_name;
          char            *parent_display_x11_authority_file;
-@@ -102,10 +104,12 @@ enum {
+@@ -102,15 +104,18 @@ enum {
          PROP_0,
          PROP_DISPLAY_ID,
          PROP_DISPLAY_NAME,
@@ -3608,7 +3659,13 @@
          PROP_DISPLAY_X11_AUTHORITY_FILE
  };
  
-@@ -669,6 +673,24 @@ gdm_slave_real_start (GdmSlave *slave)
+ enum {
+         STOPPED,
++        FAILED,
+         LAST_SIGNAL
+ };
+ 
+@@ -669,6 +674,24 @@ gdm_slave_real_start (GdmSlave *slave)
  
          error = NULL;
          res = dbus_g_proxy_call (slave->priv->display_proxy,
@@ -3633,7 +3690,7 @@
                                   "GetX11DisplayNumber",
                                   &error,
                                   G_TYPE_INVALID,
-@@ -758,6 +780,24 @@ gdm_slave_real_start (GdmSlave *slave)
+@@ -758,6 +781,24 @@ gdm_slave_real_start (GdmSlave *slave)
                  return FALSE;
          }
  
@@ -3658,11 +3715,19 @@
          return TRUE;
  }
  
-@@ -813,6 +853,34 @@ gdm_slave_stopped (GdmSlave *slave)
+@@ -813,6 +854,42 @@ gdm_slave_stopped (GdmSlave *slave)
          g_signal_emit (slave, signals [STOPPED], 0);
  }
  
 +void
++gdm_slave_failed (GdmSlave *slave)
++{
++        g_return_if_fail (GDM_IS_SLAVE (slave));
++
++        g_signal_emit (slave, signals [FAILED], 0);
++}
++
++void
 +gdm_slave_set_console_session_id (GdmSlave   *slave,
 +                                  const char *session_id)
 +{
@@ -3693,7 +3758,7 @@
  gboolean
  gdm_slave_add_user_authorization (GdmSlave   *slave,
                                    const char *username,
-@@ -1396,6 +1464,59 @@ gdm_slave_switch_to_user_session (GdmSlave   *slave,
+@@ -1396,6 +1473,59 @@ gdm_slave_switch_to_user_session (GdmSla
          return ret;
  }
  
@@ -3753,7 +3818,7 @@
  static void
  _gdm_slave_set_display_id (GdmSlave   *slave,
                             const char *id)
-@@ -1412,6 +1533,15 @@ _gdm_slave_set_display_name (GdmSlave   *slave,
+@@ -1412,6 +1542,15 @@ _gdm_slave_set_display_name (GdmSlave   
          slave->priv->display_name = g_strdup (name);
  }
  
@@ -3769,7 +3834,7 @@
  static void
  _gdm_slave_set_display_number (GdmSlave   *slave,
                                 int         number)
-@@ -1444,6 +1574,14 @@ _gdm_slave_set_display_seat_id (GdmSlave   *slave,
+@@ -1444,6 +1583,14 @@ _gdm_slave_set_display_seat_id (GdmSlave
  }
  
  static void
@@ -3784,7 +3849,7 @@
  _gdm_slave_set_display_is_local (GdmSlave   *slave,
                                   gboolean    is)
  {
-@@ -1467,6 +1605,9 @@ gdm_slave_set_property (GObject      *object,
+@@ -1467,6 +1614,9 @@ gdm_slave_set_property (GObject      *ob
          case PROP_DISPLAY_NAME:
                  _gdm_slave_set_display_name (self, g_value_get_string (value));
                  break;
@@ -3794,7 +3859,7 @@
          case PROP_DISPLAY_NUMBER:
                  _gdm_slave_set_display_number (self, g_value_get_int (value));
                  break;
-@@ -1476,6 +1617,9 @@ gdm_slave_set_property (GObject      *object,
+@@ -1476,6 +1626,9 @@ gdm_slave_set_property (GObject      *ob
          case PROP_DISPLAY_SEAT_ID:
                  _gdm_slave_set_display_seat_id (self, g_value_get_string (value));
                  break;
@@ -3804,7 +3869,7 @@
          case PROP_DISPLAY_X11_AUTHORITY_FILE:
                  _gdm_slave_set_display_x11_authority_file (self, g_value_get_string (value));
                  break;
-@@ -1505,6 +1649,9 @@ gdm_slave_get_property (GObject    *object,
+@@ -1505,6 +1658,9 @@ gdm_slave_get_property (GObject    *obje
          case PROP_DISPLAY_NAME:
                  g_value_set_string (value, self->priv->display_name);
                  break;
@@ -3814,7 +3879,7 @@
          case PROP_DISPLAY_NUMBER:
                  g_value_set_int (value, self->priv->display_number);
                  break;
-@@ -1514,6 +1661,9 @@ gdm_slave_get_property (GObject    *object,
+@@ -1514,6 +1670,9 @@ gdm_slave_get_property (GObject    *obje
          case PROP_DISPLAY_SEAT_ID:
                  g_value_set_string (value, self->priv->display_seat_id);
                  break;
@@ -3824,7 +3889,7 @@
          case PROP_DISPLAY_X11_AUTHORITY_FILE:
                  g_value_set_string (value, self->priv->display_x11_authority_file);
                  break;
-@@ -1608,6 +1758,13 @@ gdm_slave_class_init (GdmSlaveClass *klass)
+@@ -1608,6 +1767,13 @@ gdm_slave_class_init (GdmSlaveClass *kla
                                                                NULL,
                                                                G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
          g_object_class_install_property (object_class,
@@ -3838,7 +3903,7 @@
                                           PROP_DISPLAY_NUMBER,
                                           g_param_spec_int ("display-number",
                                                             "display number",
-@@ -1631,6 +1788,13 @@ gdm_slave_class_init (GdmSlaveClass *klass)
+@@ -1631,6 +1797,13 @@ gdm_slave_class_init (GdmSlaveClass *kla
                                                                NULL,
                                                                G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
          g_object_class_install_property (object_class,
@@ -3852,7 +3917,25 @@
                                           PROP_DISPLAY_X11_AUTHORITY_FILE,
                                           g_param_spec_string ("display-x11-authority-file",
                                                                "",
-@@ -1685,6 +1849,7 @@ gdm_slave_finalize (GObject *object)
+@@ -1656,6 +1829,17 @@ gdm_slave_class_init (GdmSlaveClass *kla
+                               G_TYPE_NONE,
+                               0);
+ 
++        signals [FAILED] =
++                g_signal_new ("failed",
++                              G_TYPE_FROM_CLASS (object_class),
++                              G_SIGNAL_RUN_LAST,
++                              G_STRUCT_OFFSET (GdmSlaveClass, failed),
++                              NULL,
++                              NULL,
++                              g_cclosure_marshal_VOID__VOID,
++                              G_TYPE_NONE,
++                              0);
++
+         dbus_g_object_type_install_info (GDM_TYPE_SLAVE, &dbus_glib_gdm_slave_object_info);
+ }
+ 
+@@ -1685,6 +1869,7 @@ gdm_slave_finalize (GObject *object)
          g_free (slave->priv->id);
          g_free (slave->priv->display_id);
          g_free (slave->priv->display_name);
@@ -3864,7 +3947,15 @@
 index af28b00..3783c2a 100644
 --- a/daemon/gdm-slave.h
 +++ b/daemon/gdm-slave.h
-@@ -72,13 +72,17 @@ gboolean            gdm_slave_add_user_authorization (GdmSlave   *slave,
+@@ -51,6 +51,7 @@ typedef struct
+ 
+         /* signals */
+         void (*stopped) (GdmSlave *slave);
++        void (*failed)  (GdmSlave *slave);
+ } GdmSlaveClass;
+ 
+ GType               gdm_slave_get_type               (void);
+@@ -72,13 +73,17 @@ gboolean            gdm_slave_add_user_a
  gboolean            gdm_slave_switch_to_user_session (GdmSlave   *slave,
                                                        const char *username);
  
@@ -4158,3 +4249,47 @@
  }
  
  static void
+--- gdm-2.30.6/daemon/gdm-slave-proxy.c-orig	2011-07-27 09:59:59.771080840 -0500
++++ gdm-2.30.6/daemon/gdm-slave-proxy.c	2011-07-27 10:04:27.246033622 -0500
+@@ -245,6 +245,12 @@ kill_slave (GdmSlaveProxy *slave)
+                 g_warning ("Unable to kill slave process");
+         } else {
+                 exit_status = gdm_wait_on_pid (slave->priv->pid);
++                g_debug ("GdmSlaveProxy: Slave exit status %d", exit_status);
++                if (exit_status != 0) {
++                        gdm_dynamic_display_respawn (TRUE);
++                } else {
++                        gdm_dynamic_display_respawn (FALSE);
++                }
+                 g_spawn_close_pid (slave->priv->pid);
+                 slave->priv->pid = 0;
+         }
+--- gdm-2.30.6/daemon/simple-slave-main.c-orig	2011-07-27 09:59:16.750877052 -0500
++++ gdm-2.30.6/daemon/simple-slave-main.c	2011-07-27 10:04:27.244027656 -0500
+@@ -154,6 +154,15 @@ on_slave_stopped (GdmSlave   *slave,
+         g_main_loop_quit (main_loop);
+ }
+ 
++static void
++on_slave_failed (GdmSlave   *slave,
++                 GMainLoop  *main_loop)
++{
++        g_debug ("slave failed");
++        gdm_return_code = 1;
++        g_main_loop_quit (main_loop);
++}
++
+ static gboolean
+ is_debug_set (void)
+ {
+@@ -256,6 +265,10 @@ main (int    argc,
+                           "stopped",
+                           G_CALLBACK (on_slave_stopped),
+                           main_loop);
++        g_signal_connect (slave,
++                          "failed",
++                          G_CALLBACK (on_slave_failed),
++                          main_loop);
+         gdm_slave_start (slave);
+ 
+         g_main_loop_run (main_loop);
--- a/patches/gdm-09-lang.diff	Thu Jul 28 02:01:12 2011 +0000
+++ b/patches/gdm-09-lang.diff	Thu Jul 28 03:50:58 2011 +0000
@@ -15,7 +15,7 @@
          if (!g_regex_match (re, name, 0, &match_info) ||
              g_match_info_is_partial_match (match_info)) {
 -                g_warning ("locale %s isn't valid\n", name);
-+		g_debug ("locale %s isn't valid\n", name);
++		 g_debug ("locale %s isn't valid\n", name);
                  goto out;
          }
  
@@ -112,7 +112,7 @@
          mapped = g_mapped_file_new (ARCHIVE_FILE, FALSE, &error);
          if (mapped == NULL) {
 -                g_warning ("Mapping failed for %s: %s", ARCHIVE_FILE, error->message);
-+		g_debug ("Mapping failed for %s: %s", ARCHIVE_FILE, error->message);
++		 g_debug ("Mapping failed for %s: %s", ARCHIVE_FILE, error->message);
                  g_error_free (error);
                  return FALSE;
          }