r28440 - in /desktop/experimental/gdm3/debian: ./ patches/

joss at users.alioth.debian.org joss at users.alioth.debian.org
Tue Jun 14 22:20:55 UTC 2011


Author: joss
Date: Tue Jun 14 22:20:55 2011
New Revision: 28440

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=28440
Log:
* 18_switch_kill_greeter.patch, 20_endsession_respawn.patch: replaced 
  by a series of cleaned up upstream patches.
  + 17_switch_on_finish.patch: add the switch-on-finish property to 
    displays.
  + 18_parametrize_create_display.patch: allow the daemon to create an 
    arbitrary type of display.
  + 19_static_transient_display.patch: share the respawn logic between 
    static and transient displays.
  + 20_switch_kill_greeter.patch: here is the code that kills the 
    unnecessary greeter if we support -novtswitch.
* Pass --with-vt-switch-workaround on non-Linux architectures.

Added:
    desktop/experimental/gdm3/debian/patches/17_switch_on_finish.patch
      - copied, changed from r28326, desktop/experimental/gdm3/debian/patches/20_endsession_respawn.patch
    desktop/experimental/gdm3/debian/patches/18_parametrize_create_display.patch
    desktop/experimental/gdm3/debian/patches/19_static_transient_display.patch
    desktop/experimental/gdm3/debian/patches/20_switch_kill_greeter.patch
Removed:
    desktop/experimental/gdm3/debian/patches/19_configure_xserver.patch
    desktop/experimental/gdm3/debian/patches/20_endsession_respawn.patch
Modified:
    desktop/experimental/gdm3/debian/changelog
    desktop/experimental/gdm3/debian/patches/series
    desktop/experimental/gdm3/debian/rules

Modified: desktop/experimental/gdm3/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/gdm3/debian/changelog?rev=28440&op=diff
==============================================================================
--- desktop/experimental/gdm3/debian/changelog [utf-8] (original)
+++ desktop/experimental/gdm3/debian/changelog [utf-8] Tue Jun 14 22:20:55 2011
@@ -4,6 +4,17 @@
   * greeter.gsettings: add an example of how to disable the sound.
     Closes: #628858.
   * 06_first_vt.patch: update to add Hurd support. Closes: #629366.
+  * 18_switch_kill_greeter.patch, 20_endsession_respawn.patch: replaced 
+    by a series of cleaned up upstream patches.
+    + 17_switch_on_finish.patch: add the switch-on-finish property to 
+      displays.
+    + 18_parametrize_create_display.patch: allow the daemon to create an 
+      arbitrary type of display.
+    + 19_static_transient_display.patch: share the respawn logic between 
+      static and transient displays.
+    + 20_switch_kill_greeter.patch: here is the code that kills the 
+      unnecessary greeter if we support -novtswitch.
+  * Pass --with-vt-switch-workaround on non-Linux architectures.
 
  -- Josselin Mouette <joss at debian.org>  Thu, 02 Jun 2011 12:43:17 +0200
 

Copied: desktop/experimental/gdm3/debian/patches/17_switch_on_finish.patch (from r28326, desktop/experimental/gdm3/debian/patches/20_endsession_respawn.patch)
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/gdm3/debian/patches/17_switch_on_finish.patch?rev=28440&op=diff
==============================================================================
--- desktop/experimental/gdm3/debian/patches/20_endsession_respawn.patch [utf-8] (original)
+++ desktop/experimental/gdm3/debian/patches/17_switch_on_finish.patch [utf-8] Tue Jun 14 22:20:55 2011
@@ -1,145 +1,189 @@
-Index: gdm-3.0.0/daemon/gdm-display.c
-===================================================================
---- gdm-3.0.0.orig/daemon/gdm-display.c	2010-10-01 13:54:28.000000000 +0200
-+++ gdm-3.0.0/daemon/gdm-display.c	2011-04-28 21:17:03.829368891 +0200
-@@ -67,6 +67,7 @@ struct GdmDisplayPrivate
+From 3fbe50b400dc0b47858498301b84842ac0b8428d Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode at redhat.com>
+Date: Wed, 18 May 2011 22:37:26 -0400
+Subject: [PATCH] daemon: add switch-on-finish property to display
+
+When a display exits, sometimes it's desirable to
+jump to a login screen.
+
+This depends if the display is transient or not, and
+also whether the display is hosting an already logged
+in session or not.
+
+This commit adds a property to the display object that
+says whether a switch should happen or not.
+
+Note the code to actually perform the switch will get
+added in a follow up commit.
+
+Based on work by Josselin Mouette <joss at debian.org>
+
+https://bugzilla.gnome.org/show_bug.cgi?id=618047
+---
+ daemon/gdm-display.c           |   48 ++++++++++++++++++++++++++++++++++++++++
+ daemon/gdm-display.h           |    4 +++
+ daemon/gdm-display.xml         |    3 ++
+ daemon/gdm-slave.c             |   30 +++++++++++++++++++++++++
+ daemon/gdm-transient-display.c |    1 +
+ 5 files changed, 86 insertions(+), 0 deletions(-)
+
+diff --git a/daemon/gdm-display.c b/daemon/gdm-display.c
+index abedc0b..84b4925 100644
+--- a/daemon/gdm-display.c
++++ b/daemon/gdm-display.c
+@@ -66,6 +66,7 @@ struct GdmDisplayPrivate
+         GdmDisplayAccessFile *access_file;
  
          gboolean              is_local;
++        gboolean              switch_on_finish;
          guint                 finish_idle_id;
-+        gboolean              needs_respawn;
  
          GdmSlaveProxy        *slave_proxy;
-         DBusGConnection      *connection;
-@@ -302,6 +303,20 @@ gdm_display_set_slave_bus_name (GdmDispl
-         return ret;
+@@ -84,6 +85,7 @@ enum {
+         PROP_X11_COOKIE,
+         PROP_X11_AUTHORITY_FILE,
+         PROP_IS_LOCAL,
++        PROP_SWITCH_ON_FINISH,
+         PROP_SLAVE_COMMAND,
+ };
+ 
+@@ -134,6 +136,14 @@ gdm_display_get_status (GdmDisplay *display)
+         return display->priv->status;
  }
  
 +gboolean
-+gdm_display_set_needs_respawn (GdmDisplay *display,
-+                               gboolean    respawn,
-+                               GError    **error)
-+{
++gdm_display_get_switch_on_finish (GdmDisplay *display)
++{
++        g_return_val_if_fail (GDM_IS_DISPLAY (display), 0);
++
++        return display->priv->switch_on_finish;
++}
++
+ static GdmDisplayAccessFile *
+ _create_access_file_for_user (GdmDisplay  *display,
+                               const char  *username,
+@@ -824,6 +834,30 @@ _gdm_display_set_is_local (GdmDisplay     *display,
+ }
+ 
+ static void
++_gdm_display_set_switch_on_finish (GdmDisplay     *display,
++                                   gboolean        switch_on_finish)
++{
++        display->priv->switch_on_finish = switch_on_finish;
++}
++
++gboolean
++gdm_display_set_switch_on_finish (GdmDisplay *display,
++                                  gboolean    switch_display,
++                                  GError    **error)
++{
++        gboolean ret = TRUE;
++
 +        g_return_val_if_fail (GDM_IS_DISPLAY (display), FALSE);
 +
-+        g_debug ("GdmDisplay: %s respawn on display %s", respawn?"Enabling":"Disabling", display->priv->x11_display_name);
-+
-+        display->priv->needs_respawn = respawn;
-+
-+        return TRUE;
-+}
-+
- static void
- gdm_display_real_get_timed_login_details (GdmDisplay *display,
-                                           gboolean   *enabledp,
-@@ -728,6 +743,34 @@ gdm_display_unmanage (GdmDisplay *displa
- }
- 
- gboolean
-+gdm_display_respawn_or_finish (GdmDisplay *display)
-+{
-+        g_return_val_if_fail (GDM_IS_DISPLAY (display), FALSE);
-+
-+        if (display->priv->needs_respawn) {
-+                int status;
-+
-+                g_debug ("GdmDisplay: respawning display %s", display->priv->x11_display_name);
-+                display->priv->needs_respawn = FALSE;
-+
-+                gdm_display_unmanage (display);
-+
-+                status = gdm_display_get_status (display);
-+                if (status != GDM_DISPLAY_FAILED) {
-+                        gdm_display_manage (display);
-+                }
-+        } else {
-+                /* Since this is called from the children's finish,
-+                   don't call it again, only call real_finish. */
-+                gdm_display_real_finish (display);
-+
-+                gdm_display_unmanage (display);
-+        }
-+
-+        return TRUE;
-+}
-+
-+gboolean
- gdm_display_get_id (GdmDisplay         *display,
-                     char              **id,
-                     GError            **error)
-Index: gdm-3.0.0/daemon/gdm-display.h
-===================================================================
---- gdm-3.0.0.orig/daemon/gdm-display.h	2010-10-01 13:54:28.000000000 +0200
-+++ gdm-3.0.0/daemon/gdm-display.h	2011-04-28 21:17:03.829368891 +0200
-@@ -96,6 +96,7 @@ gboolean            gdm_display_prepare
- gboolean            gdm_display_manage                         (GdmDisplay *display);
- gboolean            gdm_display_finish                         (GdmDisplay *display);
- gboolean            gdm_display_unmanage                       (GdmDisplay *display);
-+gboolean            gdm_display_respawn_or_finish              (GdmDisplay *display);
- 
- 
- /* exported to bus */
-@@ -140,6 +141,9 @@ gboolean            gdm_display_remove_u
++        g_debug ("GdmDisplay: Setting display to %sswitch to login screen on finish",
++                 switch_display? "" : "not ");
++
++        _gdm_display_set_switch_on_finish (display, switch_display);
++
++        return ret;
++}
++
++static void
+ _gdm_display_set_slave_command (GdmDisplay     *display,
+                                 const char     *command)
+ {
+@@ -866,6 +900,9 @@ gdm_display_set_property (GObject        *object,
+         case PROP_IS_LOCAL:
+                 _gdm_display_set_is_local (self, g_value_get_boolean (value));
+                 break;
++        case PROP_SWITCH_ON_FINISH:
++                _gdm_display_set_switch_on_finish (self, g_value_get_boolean (value));
++                break;
+         case PROP_SLAVE_COMMAND:
+                 _gdm_display_set_slave_command (self, g_value_get_string (value));
+                 break;
+@@ -914,6 +951,9 @@ gdm_display_get_property (GObject        *object,
+         case PROP_IS_LOCAL:
+                 g_value_set_boolean (value, self->priv->is_local);
+                 break;
++        case PROP_SWITCH_ON_FINISH:
++                g_value_set_boolean (value, self->priv->switch_on_finish);
++                break;
+         case PROP_SLAVE_COMMAND:
+                 g_value_set_string (value, self->priv->slave_command);
+                 break;
+@@ -1086,6 +1126,14 @@ gdm_display_class_init (GdmDisplayClass *klass)
+                                                                G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+ 
+         g_object_class_install_property (object_class,
++                                         PROP_SWITCH_ON_FINISH,
++                                         g_param_spec_boolean ("switch-on-finish",
++                                                               NULL,
++                                                               NULL,
++                                                               TRUE,
++                                                               G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
++
++        g_object_class_install_property (object_class,
+                                          PROP_SLAVE_COMMAND,
+                                          g_param_spec_string ("slave-command",
+                                                               "slave command",
+diff --git a/daemon/gdm-display.h b/daemon/gdm-display.h
+index 607ea1d..e3aa860 100644
+--- a/daemon/gdm-display.h
++++ b/daemon/gdm-display.h
+@@ -88,6 +88,7 @@ GQuark              gdm_display_error_quark                    (void);
+ GType               gdm_display_get_type                       (void);
+ 
+ int                 gdm_display_get_status                     (GdmDisplay *display);
++gboolean            gdm_display_get_switch_on_finish           (GdmDisplay *display);
+ time_t              gdm_display_get_creation_time              (GdmDisplay *display);
+ char *              gdm_display_get_user_auth                  (GdmDisplay *display);
+ 
+@@ -140,6 +141,9 @@ gboolean            gdm_display_remove_user_authorization      (GdmDisplay *disp
  gboolean            gdm_display_set_slave_bus_name             (GdmDisplay *display,
                                                                  const char *name,
                                                                  GError    **error);
-+gboolean            gdm_display_set_needs_respawn              (GdmDisplay *display,
-+                                                                gboolean    respawn,
++gboolean            gdm_display_set_switch_on_finish           (GdmDisplay *display,
++                                                                gboolean    switch_display,
 +                                                                GError    **error);
  
  
  G_END_DECLS
-Index: gdm-3.0.0/daemon/gdm-display.xml
-===================================================================
---- gdm-3.0.0.orig/daemon/gdm-display.xml	2010-10-01 13:54:28.000000000 +0200
-+++ gdm-3.0.0/daemon/gdm-display.xml	2011-04-28 21:17:03.829368891 +0200
+diff --git a/daemon/gdm-display.xml b/daemon/gdm-display.xml
+index a92e37f..d3ce4a4 100644
+--- a/daemon/gdm-display.xml
++++ b/daemon/gdm-display.xml
 @@ -35,6 +35,9 @@
      <method name="SetSlaveBusName">
        <arg name="name" direction="in" type="s"/>
      </method>
-+    <method name="SetNeedsRespawn">
-+      <arg name="respawn" direction="in" type="b"/>
++    <method name="SetSwitchOnFinish">
++      <arg name="switch_display" direction="in" type="b"/>
 +    </method>
      <method name="GetTimedLoginDetails">
        <arg name="enabled" direction="out" type="b"/>
        <arg name="username" direction="out" type="s"/>
-Index: gdm-3.0.0/daemon/gdm-simple-slave.c
-===================================================================
---- gdm-3.0.0.orig/daemon/gdm-simple-slave.c	2011-04-28 20:40:41.000000000 +0200
-+++ gdm-3.0.0/daemon/gdm-simple-slave.c	2011-04-28 21:17:03.829368891 +0200
-@@ -116,6 +116,9 @@ on_session_started (GdmSession       *se
- 
-         g_debug ("GdmSimpleSlave: session started %d", pid);
- 
-+        /* Respawn the display when the user session has finished */
-+        gdm_slave_set_needs_respawn (GDM_SLAVE (slave), TRUE);
-+
-         /* Run the PreSession script. gdmslave suspends until script has terminated */
-         username = gdm_session_direct_get_username (slave->priv->session);
-         if (username != NULL) {
-Index: gdm-3.0.0/daemon/gdm-slave.c
-===================================================================
---- gdm-3.0.0.orig/daemon/gdm-slave.c	2011-04-28 20:14:05.078895519 +0200
-+++ gdm-3.0.0/daemon/gdm-slave.c	2011-04-28 21:19:53.402197886 +0200
-@@ -649,6 +649,37 @@ gdm_slave_set_slave_bus_name (GdmSlave *
-         return res;
+diff --git a/daemon/gdm-slave.c b/daemon/gdm-slave.c
+index 2dc0323..9fd6579 100644
+--- a/daemon/gdm-slave.c
++++ b/daemon/gdm-slave.c
+@@ -1438,6 +1438,31 @@ session_unlock (GdmSlave   *slave,
+         return TRUE;
  }
  
-+gboolean
-+gdm_slave_set_needs_respawn (GdmSlave *slave,
-+                             gboolean  respawn)
++static void
++set_switch_display_on_finish (GdmSlave *slave,
++                              gboolean  switch_display)
 +{
 +        gboolean    res;
 +        GError     *error;
 +
-+        /* Never, ever respawn a nested display */
-+        /* if (slave->priv->display_is_nested)
-+                respawn = FALSE; */
-+
 +        error = NULL;
 +        res = dbus_g_proxy_call (slave->priv->display_proxy,
-+                                 "SetNeedsRespawn",
++                                 "SetSwitchOnFinish",
 +                                 &error,
-+                                 G_TYPE_BOOLEAN, respawn,
++                                 G_TYPE_BOOLEAN, switch_display,
 +                                 G_TYPE_INVALID,
 +                                 G_TYPE_INVALID);
 +
@@ -151,86 +195,34 @@
 +                        g_warning ("Failed to set respawn on parent display");
 +                }
 +        }
-+
-+        return res;
-+}
-+
- static gboolean
- gdm_slave_real_start (GdmSlave *slave)
- {
-Index: gdm-3.0.0/daemon/gdm-slave.h
-===================================================================
---- gdm-3.0.0.orig/daemon/gdm-slave.h	2011-04-04 16:37:16.000000000 +0200
-+++ gdm-3.0.0/daemon/gdm-slave.h	2011-04-28 21:17:03.829368891 +0200
-@@ -72,6 +72,9 @@ gboolean            gdm_slave_add_user_a
- gboolean            gdm_slave_switch_to_user_session (GdmSlave   *slave,
-                                                       const char *username);
- 
-+gboolean            gdm_slave_set_needs_respawn      (GdmSlave *slave,
-+                                                      gboolean  respawn);
-+
- gboolean            gdm_slave_connect_to_x11_display (GdmSlave   *slave);
- 
- void                gdm_slave_set_initial_cursor_position (GdmSlave *slave);
-Index: gdm-3.0.0/daemon/gdm-transient-display.c
-===================================================================
---- gdm-3.0.0.orig/daemon/gdm-transient-display.c	2010-10-01 13:54:28.000000000 +0200
-+++ gdm-3.0.0/daemon/gdm-transient-display.c	2011-04-28 21:17:03.829368891 +0200
-@@ -100,12 +100,9 @@ gdm_transient_display_finish (GdmDisplay
- {
-         g_return_val_if_fail (GDM_IS_DISPLAY (display), FALSE);
- 
--        GDM_DISPLAY_CLASS (gdm_transient_display_parent_class)->finish (display);
-+        /* Only respawn if needed. */
- 
--        /* we don't restart/remanage transient displays */
--        gdm_display_unmanage (display);
--
--        return TRUE;
-+        return gdm_display_respawn_or_finish (display);
- }
- 
- static gboolean
-Index: gdm-3.0.0/daemon/gdm-static-display.c
-===================================================================
---- gdm-3.0.0.orig/daemon/gdm-static-display.c	2011-01-15 03:20:13.000000000 +0100
-+++ gdm-3.0.0/daemon/gdm-static-display.c	2011-04-28 21:17:03.833368919 +0200
-@@ -98,22 +98,13 @@ gdm_static_display_manage (GdmDisplay *d
- static gboolean
- gdm_static_display_finish (GdmDisplay *display)
- {
--        int status;
--
-         g_return_val_if_fail (GDM_IS_DISPLAY (display), FALSE);
- 
--        /* Don't call parent's finish since we don't ever
--           want to be put in the FINISHED state */
--
--        /* restart static displays */
--        gdm_display_unmanage (display);
--
--        status = gdm_display_get_status (display);
--        if (status != GDM_DISPLAY_FAILED) {
--                gdm_display_manage (display);
--        }
-+        /* Only respawn if needed, even for static displays.
-+           Avoids the case where :0 keeps respawning while
-+           used for switching to an existing session in e.g. :1. */
- 
--        return TRUE;
-+        return gdm_display_respawn_or_finish (display);
- }
- 
- static gboolean
-Index: gdm-3.0.0/daemon/gdm-local-display-factory.c
-===================================================================
---- gdm-3.0.0.orig/daemon/gdm-local-display-factory.c	2010-10-01 13:54:28.000000000 +0200
-+++ gdm-3.0.0/daemon/gdm-local-display-factory.c	2011-04-28 21:17:03.833368919 +0200
-@@ -301,7 +301,6 @@ on_static_display_status_changed (GdmDis
-                 gdm_display_store_remove (store, display);
-                 /* reset num failures */
-                 factory->priv->num_failures = 0;
--                create_display (factory);
-                 break;
-         case GDM_DISPLAY_FAILED:
-                 /* leave the display number in factory->priv->displays
++}
++
+ gboolean
+ gdm_slave_switch_to_user_session (GdmSlave   *slave,
+                                   const char *username)
+@@ -1468,6 +1493,11 @@ gdm_slave_switch_to_user_session (GdmSlave   *slave,
+                 g_debug ("GdmSlave: unable to unlock session: %s", ssid_to_activate);
+         }
+ 
++        /* Since we're switching to a new display, make sure we don't switch again when
++         * this display finishes.
++         */
++        set_switch_display_on_finish (slave, FALSE);
++
+         ret = TRUE;
+ 
+  out:
+diff --git a/daemon/gdm-transient-display.c b/daemon/gdm-transient-display.c
+index dd33547..01813f7 100644
+--- a/daemon/gdm-transient-display.c
++++ b/daemon/gdm-transient-display.c
+@@ -210,6 +210,7 @@ gdm_transient_display_new (int display_number)
+         object = g_object_new (GDM_TYPE_TRANSIENT_DISPLAY,
+                                "x11-display-number", display_number,
+                                "x11-display-name", x11_display,
++                               "switch-on-finish", TRUE,
+                                NULL);
+         g_free (x11_display);
+ 
+-- 
+1.7.5.1

Added: desktop/experimental/gdm3/debian/patches/18_parametrize_create_display.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/gdm3/debian/patches/18_parametrize_create_display.patch?rev=28440&op=file
==============================================================================
--- desktop/experimental/gdm3/debian/patches/18_parametrize_create_display.patch (added)
+++ desktop/experimental/gdm3/debian/patches/18_parametrize_create_display.patch [utf-8] Tue Jun 14 22:20:55 2011
@@ -1,0 +1,108 @@
+From b21df58001691866b54ed4e0bf6d3d12ca6b4fa9 Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode at redhat.com>
+Date: Wed, 18 May 2011 01:49:22 -0400
+Subject: [PATCH] daemon: parameterize create_display
+
+There's some logic in create_display and friends,
+that would be good to reuse for transient displays.
+
+This commit adds a type argument to create_display
+to say what kind of display to create.
+
+Right now it only supports the one type it's always
+supported, but that will change in a follow up commit.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=618047
+---
+ daemon/gdm-local-display-factory.c |   30 ++++++++++++++++--------------
+ 1 files changed, 16 insertions(+), 14 deletions(-)
+
+Index: gdm-3.0.4/daemon/gdm-local-display-factory.c
+===================================================================
+--- gdm-3.0.4.orig/daemon/gdm-local-display-factory.c	2011-05-31 16:52:04.000000000 +0200
++++ gdm-3.0.4/daemon/gdm-local-display-factory.c	2011-06-14 23:56:58.034815831 +0200
+@@ -65,7 +65,8 @@ static void     gdm_local_display_factor
+ static void     gdm_local_display_factory_init          (GdmLocalDisplayFactory      *factory);
+ static void     gdm_local_display_factory_finalize      (GObject                     *object);
+ 
+-static GdmDisplay *create_display                       (GdmLocalDisplayFactory      *factory);
++static GdmDisplay *create_display                       (GdmLocalDisplayFactory      *factory,
++                                                         GType                        type);
+ 
+ static gpointer local_display_factory_object = NULL;
+ 
+@@ -276,9 +277,9 @@ gdm_local_display_factory_create_product
+ }
+ 
+ static void
+-on_static_display_status_changed (GdmDisplay             *display,
+-                                  GParamSpec             *arg1,
+-                                  GdmLocalDisplayFactory *factory)
++on_display_status_changed (GdmDisplay             *display,
++                           GParamSpec             *arg1,
++                           GdmLocalDisplayFactory *factory)
+ {
+         int              status;
+         GdmDisplayStore *store;
+@@ -301,7 +302,7 @@ on_static_display_status_changed (GdmDis
+                 gdm_display_store_remove (store, display);
+                 /* reset num failures */
+                 factory->priv->num_failures = 0;
+-                create_display (factory);
++                create_display (factory, GDM_TYPE_STATIC_DISPLAY);
+                 break;
+         case GDM_DISPLAY_FAILED:
+                 /* leave the display number in factory->priv->displays
+@@ -314,7 +315,7 @@ on_static_display_status_changed (GdmDis
+                         /* FIXME: should monitor hardware changes to
+                            try again when seats change */
+                 } else {
+-                        create_display (factory);
++                        create_display (factory, GDM_TYPE_STATIC_DISPLAY);
+                 }
+                 break;
+         case GDM_DISPLAY_UNMANAGED:
+@@ -330,18 +331,19 @@ on_static_display_status_changed (GdmDis
+ }
+ 
+ static GdmDisplay *
+-create_display (GdmLocalDisplayFactory *factory)
++create_display (GdmLocalDisplayFactory *factory,
++                GType                   type)
+ {
+         GdmDisplay *display;
+         guint32     num;
+ 
+         num = take_next_display_number (factory);
+ 
+-#if 0
+-        display = gdm_static_factory_display_new (num);
+-#else
+-        display = gdm_static_display_new (num);
+-#endif
++        if (type == GDM_TYPE_STATIC_DISPLAY) {
++                display = gdm_static_display_new (num);
++        } else {
++                g_assert_not_reached ();
++        }
+         if (display == NULL) {
+                 g_warning ("Unable to create display: %d", num);
+                 return NULL;
+@@ -352,7 +354,7 @@ create_display (GdmLocalDisplayFactory *
+ 
+         g_signal_connect (display,
+                           "notify::status",
+-                          G_CALLBACK (on_static_display_status_changed),
++                          G_CALLBACK (on_display_status_changed),
+                           factory);
+ 
+         store_display (factory, num, display);
+@@ -379,7 +381,7 @@ gdm_local_display_factory_start (GdmDisp
+         ret = TRUE;
+ 
+         /* FIXME: use seat configuration */
+-        display = create_display (factory);
++        display = create_display (factory, GDM_TYPE_STATIC_DISPLAY);
+         if (display == NULL) {
+                 ret = FALSE;
+         }

Added: desktop/experimental/gdm3/debian/patches/19_static_transient_display.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/gdm3/debian/patches/19_static_transient_display.patch?rev=28440&op=file
==============================================================================
--- desktop/experimental/gdm3/debian/patches/19_static_transient_display.patch (added)
+++ desktop/experimental/gdm3/debian/patches/19_static_transient_display.patch [utf-8] Tue Jun 14 22:20:55 2011
@@ -1,0 +1,125 @@
+From ccc006a869f0e24835da68402ceb5a4323b7ceb9 Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode at redhat.com>
+Date: Wed, 18 May 2011 02:03:42 -0400
+Subject: [PATCH] daemon: share display respawn logic betewen static and
+ transient displays
+
+Right now we ignore transient displays after they're created.  We make
+no attempt to clean them up from the display store or put the user on
+a login screen when their display ends or anything like that.
+
+This commit changes the display factory to monitor transient display
+status in much the same way it monitors static display status.
+
+Note for static displays we always respawn when finishing, where
+as with transient displays either die quietly, jump to an existing
+login display, or respawn.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=618047
+---
+ daemon/gdm-local-display-factory.c |   43 +++++++++++++++++------------------
+ 1 files changed, 21 insertions(+), 22 deletions(-)
+
+Index: gdm-3.0.4/daemon/gdm-local-display-factory.c
+===================================================================
+--- gdm-3.0.4.orig/daemon/gdm-local-display-factory.c	2011-06-14 23:56:58.034815831 +0200
++++ gdm-3.0.4/daemon/gdm-local-display-factory.c	2011-06-15 00:00:16.903788372 +0200
+@@ -200,21 +200,7 @@ gdm_local_display_factory_create_transie
+ 
+         ret = FALSE;
+ 
+-        num = take_next_display_number (factory);
+-
+-        g_debug ("GdmLocalDisplayFactory: Creating transient display %d", num);
+-
+-        display = gdm_transient_display_new (num);
+-
+-        /* FIXME: don't hardcode seat1? */
+-        g_object_set (display, "seat-id", CK_SEAT1_PATH, NULL);
+-
+-        store_display (factory, num, display);
+-
+-        if (! gdm_display_manage (display)) {
+-                display = NULL;
+-                goto out;
+-        }
++        display = create_display (factory, GDM_TYPE_TRANSIENT_DISPLAY);
+ 
+         if (! gdm_display_get_id (display, id, NULL)) {
+                 display = NULL;
+@@ -223,9 +209,6 @@ gdm_local_display_factory_create_transie
+ 
+         ret = TRUE;
+  out:
+-        /* ref either held by store or not at all */
+-        g_object_unref (display);
+-
+         return ret;
+ }
+ 
+@@ -277,13 +260,22 @@ gdm_local_display_factory_create_product
+ }
+ 
+ static void
++switch_to_login_session (GdmLocalDisplayFactory *factory)
++{
++        /* FIXME: look for existing login session before starting a new one */
++        create_display (factory, GDM_TYPE_TRANSIENT_DISPLAY);
++}
++
++static void
+ on_display_status_changed (GdmDisplay             *display,
+                            GParamSpec             *arg1,
+                            GdmLocalDisplayFactory *factory)
+ {
+         int              status;
++        gboolean         switch_on_finish;
+         GdmDisplayStore *store;
+         int              num;
++        GType            type;
+ 
+         num = -1;
+         gdm_display_get_x11_display_number (display, &num, NULL);
+@@ -292,6 +284,8 @@ on_display_status_changed (GdmDisplay
+         store = gdm_display_factory_get_display_store (GDM_DISPLAY_FACTORY (factory));
+ 
+         status = gdm_display_get_status (display);
++        switch_on_finish = gdm_display_get_switch_on_finish (display);
++        type = G_OBJECT_TYPE (display);
+ 
+         g_debug ("GdmLocalDisplayFactory: static display status changed: %d", status);
+         switch (status) {
+@@ -302,7 +296,12 @@ on_display_status_changed (GdmDisplay
+                 gdm_display_store_remove (store, display);
+                 /* reset num failures */
+                 factory->priv->num_failures = 0;
+-                create_display (factory, GDM_TYPE_STATIC_DISPLAY);
++
++                if (switch_on_finish) {
++                        switch_to_login_session (factory);
++                } else if (type == GDM_TYPE_STATIC_DISPLAY) {
++                        create_display (factory, type);
++                }
+                 break;
+         case GDM_DISPLAY_FAILED:
+                 /* leave the display number in factory->priv->displays
+@@ -315,7 +314,7 @@ on_display_status_changed (GdmDisplay
+                         /* FIXME: should monitor hardware changes to
+                            try again when seats change */
+                 } else {
+-                        create_display (factory, GDM_TYPE_STATIC_DISPLAY);
++                        create_display (factory, type);
+                 }
+                 break;
+         case GDM_DISPLAY_UNMANAGED:
+@@ -341,8 +340,8 @@ create_display (GdmLocalDisplayFactory *
+ 
+         if (type == GDM_TYPE_STATIC_DISPLAY) {
+                 display = gdm_static_display_new (num);
+-        } else {
+-                g_assert_not_reached ();
++        } else if (type == GDM_TYPE_TRANSIENT_DISPLAY) {
++                display = gdm_transient_display_new (num);
+         }
+         if (display == NULL) {
+                 g_warning ("Unable to create display: %d", num);

Added: desktop/experimental/gdm3/debian/patches/20_switch_kill_greeter.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/gdm3/debian/patches/20_switch_kill_greeter.patch?rev=28440&op=file
==============================================================================
--- desktop/experimental/gdm3/debian/patches/20_switch_kill_greeter.patch (added)
+++ desktop/experimental/gdm3/debian/patches/20_switch_kill_greeter.patch [utf-8] Tue Jun 14 22:20:55 2011
@@ -1,0 +1,116 @@
+From 5ead1e4135c0ce28a8e17203d22eec4a540e5db3 Mon Sep 17 00:00:00 2001
+From: Josselin Mouette <joss at malsain.org>
+Date: Thu, 12 May 2011 16:36:39 -0400
+Subject: [PATCH] daemon: clean up greeter when unused
+
+When user switching GDM needs to show a transient greeter for
+the user to pick a name from the list and jump to that session.
+
+After the user has been jumped to the selected session we don't
+really have a use for the greeter session.  Historically, we've
+kept it around anyway, though, because X by default jumps back
+to the VT it started on when it exits, and we don't want the
+user to get thrown to an empty VT after they log out.
+
+This commit changes X to get started with the "-novtswitch"
+option, so that it doesn't do the undesirable switch-on-exit
+thing.
+
+This allows us to clean up the useless greeter following user
+switches.
+
+Based on work by Josselin Mouette <joss at debian.org>
+
+https://bugzilla.gnome.org/show_bug.cgi?id=618047
+---
+ configure.ac              |   13 +++++++++++++
+ daemon/gdm-server.c       |    8 +++++++-
+ daemon/gdm-simple-slave.c |   15 ++++++++++-----
+ 3 files changed, 30 insertions(+), 6 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 675f5a6..8bb6c75 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -238,6 +238,11 @@ AC_ARG_WITH(at-spi-registryd-directory,
+ AT_SPI_REGISTRYD_DIR=$with_at_spi_registryd_directory
+ AC_SUBST(AT_SPI_REGISTRYD_DIR)
+ 
++AC_ARG_WITH(vt-switch-workaround,
++            AS_HELP_STRING([--with-vt-switch-workaround],
++	                   [Try to workaround missing -novtswitch option for X @<:@default=nor@:>@])],,
++            [with_vt_switch_workaround="no"])
++
+ # Allow configuration of default PATH
+ #
+ withval=""
+@@ -885,6 +890,14 @@ AM_CONDITIONAL(WITH_CONSOLE_KIT, test x$use_console_kit = xyes)
+ AC_SUBST(WITH_CONSOLE_KIT)
+ 
+ dnl ---------------------------------------------------------------------------
++dnl - Check for vt switch support
++dnl ---------------------------------------------------------------------------
++
++if test "x$with_vt_switch_workaround" != "xno" ; then
++	AC_DEFINE(WITH_VT_SWITCH_WORKAROUND, 1, [Define to enable workaround for missing -novtswitch feature])
++fi
++
++dnl ---------------------------------------------------------------------------
+ dnl - Check for D-Bus
+ dnl ---------------------------------------------------------------------------
+ 
+diff --git a/daemon/gdm-server.c b/daemon/gdm-server.c
+index 339f3cc..f697a4b 100644
+--- a/daemon/gdm-server.c
++++ b/daemon/gdm-server.c
+@@ -52,6 +52,12 @@
+ 
+ extern char **environ;
+ 
++#ifdef WITH_VT_SWITCH_WORKAROUND
++#define X_SERVER_COMMAND_LINE X_SERVER " -br -verbose"
++#else
++#define X_SERVER_COMMAND_LINE X_SERVER " -br -verbose -novtswitch"
++#endif
++
+ #define GDM_SERVER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDM_TYPE_SERVER, GdmServerPrivate))
+ 
+ /* These are the servstat values, also used as server
+@@ -941,7 +947,7 @@ gdm_server_init (GdmServer *server)
+         server->priv = GDM_SERVER_GET_PRIVATE (server);
+ 
+         server->priv->pid = -1;
+-        server->priv->command = g_strdup (X_SERVER " -br -verbose");
++        server->priv->command = g_strdup (X_SERVER_COMMAND_LINE);
+         server->priv->log_dir = g_strdup (LOGDIR);
+ 
+         add_ready_handler (server);
+diff --git a/daemon/gdm-simple-slave.c b/daemon/gdm-simple-slave.c
+index ddf7a63..1ce9d03 100644
+--- a/daemon/gdm-simple-slave.c
++++ b/daemon/gdm-simple-slave.c
+@@ -471,12 +471,17 @@ start_session_timeout (GdmSimpleSlave *slave)
+         if (migrated) {
+                 destroy_session (slave);
+ 
+-                /* We don't stop the slave here because
+-                   when Xorg exits it switches to the VT it was
+-                   started from.  That interferes with fast
+-                   user switching. */
++#ifdef WITH_VT_SWITCH_WORKAROUND
++                /* If the X server doesn't support -novtswitch, then when the
++                 * user logs out from their session later, they're going to get thrown
++                 * back to the VT the greeter is currently running on. We keep the
++                 * greeter alive here, so when that happens the user doesn't see
++                 * a blank VT or some confusing thing.
++                 */
+                 queue_greeter_reset (slave);
+-
++#else
++                gdm_slave_stopped (GDM_SLAVE (slave));
++#endif
+                 goto out;
+         }
+ 
+-- 
+1.7.5.1

Modified: desktop/experimental/gdm3/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/gdm3/debian/patches/series?rev=28440&op=diff
==============================================================================
--- desktop/experimental/gdm3/debian/patches/series [utf-8] (original)
+++ desktop/experimental/gdm3/debian/patches/series [utf-8] Tue Jun 14 22:20:55 2011
@@ -9,9 +9,10 @@
 #11_xephyr_nested.patch
 14_pam_dialog.patch
 16_xserver_path.patch
-18_switch_kill_greeter.patch
-#19_configure_xserver.patch
-20_endsession_respawn.patch
+17_switch_on_finish.patch
+18_parametrize_create_display.patch
+19_static_transient_display.patch
+20_switch_kill_greeter.patch
 22_noconsole.patch
 29_grep_path.patch
 90_config_comments.patch

Modified: desktop/experimental/gdm3/debian/rules
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/gdm3/debian/rules?rev=28440&op=diff
==============================================================================
--- desktop/experimental/gdm3/debian/rules [utf-8] (original)
+++ desktop/experimental/gdm3/debian/rules [utf-8] Tue Jun 14 22:20:55 2011
@@ -38,6 +38,8 @@
 		
 ifeq (linux,$(DEB_HOST_ARCH_OS))
 	DEB_CONFIGURE_EXTRA_FLAGS += --with-selinux
+else
+	DEB_CONFIGURE_EXTRA_FLAGS += --with-vt-switch-workaround
 endif
 
 




More information about the pkg-gnome-commits mailing list