r23394 - in /desktop/unstable/gnome-session/debian: changelog patches/13_capplet_always_save.patch patches/14_crash_on_exit.patch patches/series

joss at users.alioth.debian.org joss at users.alioth.debian.org
Thu Mar 25 19:01:37 UTC 2010


Author: joss
Date: Thu Mar 25 19:01:29 2010
New Revision: 23394

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=23394
Log:
* 13_capplet_always_save.patch: stolen upstream. Ensure that the 
  capplet saves all changes when it exits. Closes: #574862.
* 14_crash_on_exit.patch: stolen upstream. Fix crash upon exit.
  Closes: #548120.

Added:
    desktop/unstable/gnome-session/debian/patches/13_capplet_always_save.patch
    desktop/unstable/gnome-session/debian/patches/14_crash_on_exit.patch
Modified:
    desktop/unstable/gnome-session/debian/changelog
    desktop/unstable/gnome-session/debian/patches/series

Modified: desktop/unstable/gnome-session/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-session/debian/changelog?rev=23394&op=diff
==============================================================================
--- desktop/unstable/gnome-session/debian/changelog [utf-8] (original)
+++ desktop/unstable/gnome-session/debian/changelog [utf-8] Thu Mar 25 19:01:29 2010
@@ -1,12 +1,16 @@
-gnome-session (2.28.0-7) UNRELEASED; urgency=low
+gnome-session (2.28.0-7) unstable; urgency=low
 
   * 12_no_gdm_fallback.patch: new patch. Don’t fall back on GDM if 
     ConsoleKit failed to reboot. CK will not even be attempted if it is 
     not available, anyway. Closes: #572085.
   * Require upower/libdevkit-power unconditionnally, now that it works 
     on kfreebsd. 
-
- -- Josselin Mouette <joss at debian.org>  Fri, 05 Mar 2010 13:45:33 +0100
+  * 13_capplet_always_save.patch: stolen upstream. Ensure that the 
+    capplet saves all changes when it exits. Closes: #574862.
+  * 14_crash_on_exit.patch: stolen upstream. Fix crash upon exit.
+    Closes: #548120.
+
+ -- Josselin Mouette <joss at debian.org>  Thu, 25 Mar 2010 20:00:57 +0100
 
 gnome-session (2.28.0-6) unstable; urgency=low
 

Added: desktop/unstable/gnome-session/debian/patches/13_capplet_always_save.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-session/debian/patches/13_capplet_always_save.patch?rev=23394&op=file
==============================================================================
--- desktop/unstable/gnome-session/debian/patches/13_capplet_always_save.patch (added)
+++ desktop/unstable/gnome-session/debian/patches/13_capplet_always_save.patch [utf-8] Thu Mar 25 19:01:29 2010
@@ -1,0 +1,25 @@
+From dd9df169196441717498ac09ee8c437fb552116e Mon Sep 17 00:00:00 2001
+From: Vincent Untz <vuntz at gnome.org>
+Date: Sun, 11 Oct 2009 20:32:53 +0000
+Subject: [capplet] Destroy the main window on close to ensure changes are saved
+
+For some reasons, sometimes it works, and sometimes it doesn't. By
+destroying the window, we make sure all objects are disposed and the
+changes are saved.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=597623
+---
+diff --git a/capplet/main.c b/capplet/main.c
+index c8829a0..861e36a 100644
+--- a/capplet/main.c
++++ b/capplet/main.c
+@@ -70,6 +70,7 @@ dialog_response (GsmPropertiesDialog *dialog,
+                         gtk_widget_destroy (d);
+                 }
+         } else {
++                gtk_widget_destroy (GTK_WIDGET (dialog));
+                 gtk_main_quit ();
+         }
+ }
+--
+cgit v0.8.3.1

Added: desktop/unstable/gnome-session/debian/patches/14_crash_on_exit.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-session/debian/patches/14_crash_on_exit.patch?rev=23394&op=file
==============================================================================
--- desktop/unstable/gnome-session/debian/patches/14_crash_on_exit.patch (added)
+++ desktop/unstable/gnome-session/debian/patches/14_crash_on_exit.patch [utf-8] Thu Mar 25 19:01:29 2010
@@ -1,0 +1,288 @@
+From b0dc999e0b45355314616321dbb6cb71e729fc9d Mon Sep 17 00:00:00 2001
+From: Romain Perier <mrpouet at gentoo.org>
+Date: Mon, 01 Feb 2010 18:41:57 +0000
+Subject: [gsm] Delay the creation of the GsmXSMPClient until it really exists
+
+We used to create the GsmXSMPClient before the XSMP connection is really
+accepted. This can lead to some issues, though. An example is:
+https://bugzilla.gnome.org/show_bug.cgi?id=598211#c19. Quoting:
+
+ "What is happening is that a new client (probably metacity in your
+ case) is opening an ICE connection in the GSM_MANAGER_PHASE_END_SESSION
+ phase, which causes a new GsmXSMPClient to be added to the client
+ store. The GSM_MANAGER_PHASE_EXIT phase then begins before the client
+ has had a chance to establish a xsmp connection, which means that
+ client->priv->conn will not be initialized at the point that xsmp_stop
+ is called on the new unregistered client."
+
+The fix is to create the GsmXSMPClient object when there's a real XSMP
+connection. This implies moving the timeout that makes sure we don't
+have an empty client to the XSMP server.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=598211
+---
+diff --git a/gnome-session/gsm-xsmp-client.c b/gnome-session/gsm-xsmp-client.c
+index 8ba1eb7..9da5fdc 100644
+--- a/gnome-session/gsm-xsmp-client.c
++++ b/gnome-session/gsm-xsmp-client.c
+@@ -51,7 +51,6 @@ struct GsmXSMPClientPrivate
+         IceConn    ice_connection;
+ 
+         guint      watch_id;
+-        guint      protocol_timeout;
+ 
+         char      *description;
+         GPtrArray *props;
+@@ -115,22 +114,6 @@ client_iochannel_watch (GIOChannel    *channel,
+         return keep_going;
+ }
+ 
+-/* Called if too much time passes between the initial connection and
+- * the XSMP protocol setup.
+- */
+-static gboolean
+-_client_protocol_timeout (GsmXSMPClient *client)
+-{
+-        g_debug ("GsmXSMPClient: client_protocol_timeout for client '%s' in ICE status %d",
+-                 client->priv->description,
+-                 IceConnectionStatus (client->priv->ice_connection));
+-
+-        gsm_client_set_status (GSM_CLIENT (client), GSM_CLIENT_FAILED);
+-        gsm_client_disconnected (GSM_CLIENT (client));
+-
+-        return FALSE;
+-}
+-
+ static SmProp *
+ find_property (GsmXSMPClient *client,
+                const char    *name,
+@@ -193,10 +176,6 @@ setup_connection (GsmXSMPClient *client)
+                                                  client);
+         g_io_channel_unref (channel);
+ 
+-        client->priv->protocol_timeout = g_timeout_add_seconds (5,
+-                                                                (GSourceFunc)_client_protocol_timeout,
+-                                                                client);
+-
+         set_description (client);
+ 
+         g_debug ("GsmXSMPClient: New client '%s'", client->priv->description);
+@@ -869,10 +848,6 @@ gsm_xsmp_client_disconnect (GsmXSMPClient *client)
+                 IceSetShutdownNegotiation (client->priv->ice_connection, FALSE);
+                 IceCloseConnection (client->priv->ice_connection);
+         }
+-
+-        if (client->priv->protocol_timeout > 0) {
+-                g_source_remove (client->priv->protocol_timeout);
+-        }
+ }
+ 
+ static void
+@@ -1305,11 +1280,6 @@ gsm_xsmp_client_connect (GsmXSMPClient *client,
+ {
+         client->priv->conn = conn;
+ 
+-        if (client->priv->protocol_timeout) {
+-                g_source_remove (client->priv->protocol_timeout);
+-                client->priv->protocol_timeout = 0;
+-        }
+-
+         g_debug ("GsmXSMPClient: Initializing client %s", client->priv->description);
+ 
+         *mask_ret = 0;
+diff --git a/gnome-session/gsm-xsmp-server.c b/gnome-session/gsm-xsmp-server.c
+index 991c895..1f0e045 100644
+--- a/gnome-session/gsm-xsmp-server.c
++++ b/gnome-session/gsm-xsmp-server.c
+@@ -91,44 +91,134 @@ typedef struct {
+         IceListenObj   listener;
+ } GsmIceConnectionData;
+ 
++typedef struct {
++        guint watch_id;
++        guint protocol_timeout;
++} GsmIceConnectionWatch;
++
++static void
++disconnect_ice_connection (IceConn ice_conn)
++{
++        IceSetShutdownNegotiation (ice_conn, FALSE);
++        IceCloseConnection (ice_conn);
++}
++
++static void
++free_ice_connection_watch (GsmIceConnectionWatch *data)
++{
++        if (data->watch_id) {
++                g_source_remove (data->watch_id);
++                data->watch_id = 0;
++        }
++
++        if (data->protocol_timeout) {
++                g_source_remove (data->protocol_timeout);
++                data->protocol_timeout = 0;
++        }
++
++        g_free (data);
++}
++
++static gboolean
++ice_protocol_timeout (IceConn ice_conn)
++{
++        GsmIceConnectionWatch *data;
++
++        g_debug ("GsmXsmpServer: ice_protocol_timeout for IceConn %p with status %d",
++                 ice_conn, IceConnectionStatus (ice_conn));
++
++        data = ice_conn->context;
++
++        free_ice_connection_watch (data);
++        disconnect_ice_connection (ice_conn);
++
++        return FALSE;
++}
++
++static gboolean
++auth_iochannel_watch (GIOChannel   *source,
++                      GIOCondition  condition,
++                      IceConn       ice_conn)
++{
++
++        GsmIceConnectionWatch *data;
++        gboolean               keep_going;
++
++        data = ice_conn->context;
++
++        switch (IceProcessMessages (ice_conn, NULL, NULL)) {
++        case IceProcessMessagesSuccess:
++                keep_going = TRUE;
++                break;
++        case IceProcessMessagesIOError:
++                g_debug ("GsmXsmpServer: IceProcessMessages returned IceProcessMessagesIOError");
++                free_ice_connection_watch (data);
++                disconnect_ice_connection (ice_conn);
++                keep_going = FALSE;
++                break;
++        case IceProcessMessagesConnectionClosed:
++                g_debug ("GsmXsmpServer: IceProcessMessages returned IceProcessMessagesConnectionClosed");
++                free_ice_connection_watch (data);
++                keep_going = FALSE;
++                break;
++        default:
++                g_assert_not_reached ();
++        }
++
++        return keep_going;
++}
++
++/* IceAcceptConnection returns a new ICE connection that is in a "pending" state,
++ * this is because authentification may be necessary.
++ * So we've to authenticate it, before accept_xsmp_connection() is called.
++ * Then each GsmXSMPClient will have its own IceConn watcher
++ */
++static void
++auth_ice_connection (IceConn ice_conn)
++{
++        GIOChannel            *channel;
++        GsmIceConnectionWatch *data;
++        int                    fd;
++
++        g_debug ("GsmXsmpServer: auth_ice_connection()");
++
++        fd = IceConnectionNumber (ice_conn);
++        fcntl (fd, F_SETFD, fcntl (fd, F_GETFD, 0) | FD_CLOEXEC);
++        channel = g_io_channel_unix_new (fd);
++
++        data = g_new0 (GsmIceConnectionWatch, 1);
++        ice_conn->context = data;
++
++        data->protocol_timeout = g_timeout_add_seconds (5,
++                                                        (GSourceFunc)ice_protocol_timeout,
++                                                        ice_conn);
++        data->watch_id = g_io_add_watch (channel,
++                                         G_IO_IN | G_IO_ERR,
++                                         (GIOFunc)auth_iochannel_watch,
++                                         ice_conn);
++        g_io_channel_unref (channel);
++}
++
+ /* This is called (by glib via xsmp->ice_connection_watch) when a
+- * connection is first received on the ICE listening socket. (We
+- * expect that the client will then initiate XSMP on the connection;
+- * if it does not, GsmXSMPClient will eventually time out and close
+- * the connection.)
+- *
+- * FIXME: it would probably make more sense to not create a
+- * GsmXSMPClient object until accept_xsmp_connection, below (and to do
+- * the timing-out here in xsmp.c).
++ * connection is first received on the ICE listening socket.
+  */
+ static gboolean
+ accept_ice_connection (GIOChannel           *source,
+                        GIOCondition          condition,
+                        GsmIceConnectionData *data)
+ {
+-        IceListenObj    listener;
+         IceConn         ice_conn;
+         IceAcceptStatus status;
+-        GsmClient      *client;
+-        GsmXsmpServer  *server;
+-
+-        listener = data->listener;
+-        server = data->server;
+ 
+         g_debug ("GsmXsmpServer: accept_ice_connection()");
+ 
+-        ice_conn = IceAcceptConnection (listener, &status);
++        ice_conn = IceAcceptConnection (data->listener, &status);
+         if (status != IceAcceptSuccess) {
+                 g_debug ("GsmXsmpServer: IceAcceptConnection returned %d", status);
+                 return TRUE;
+         }
+ 
+-        client = gsm_xsmp_client_new (ice_conn);
+-        ice_conn->context = client;
+-
+-        gsm_store_add (server->priv->client_store, gsm_client_peek_id (client), G_OBJECT (client));
+-        /* the store will own the ref */
+-        g_object_unref (client);
++        auth_ice_connection (ice_conn);
+ 
+         return TRUE;
+ }
+@@ -224,8 +314,9 @@ accept_xsmp_connection (SmsConn        sms_conn,
+                         SmsCallbacks  *callbacks_ret,
+                         char         **failure_reason_ret)
+ {
+-        IceConn        ice_conn;
+-        GsmXSMPClient *client;
++        IceConn                ice_conn;
++        GsmClient             *client;
++        GsmIceConnectionWatch *data;
+ 
+         /* FIXME: what about during shutdown but before gsm_xsmp_shutdown? */
+         if (server->priv->xsmp_sockets == NULL) {
+@@ -236,11 +327,18 @@ accept_xsmp_connection (SmsConn        sms_conn,
+         }
+ 
+         ice_conn = SmsGetIceConnection (sms_conn);
+-        client = ice_conn->context;
++        data = ice_conn->context;
+ 
+-        g_return_val_if_fail (client != NULL, TRUE);
++        /* Each GsmXSMPClient has its own IceConn watcher */
++        free_ice_connection_watch (data);
++
++        client = gsm_xsmp_client_new (ice_conn);
++
++        gsm_store_add (server->priv->client_store, gsm_client_peek_id (client), G_OBJECT (client));
++        /* the store will own the ref */
++        g_object_unref (client);
+ 
+-        gsm_xsmp_client_connect (client, sms_conn, mask_ret, callbacks_ret);
++        gsm_xsmp_client_connect (GSM_XSMP_CLIENT (client), sms_conn, mask_ret, callbacks_ret);
+ 
+         return TRUE;
+ }
+--
+cgit v0.8.3.1

Modified: desktop/unstable/gnome-session/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-session/debian/patches/series?rev=23394&op=diff
==============================================================================
--- desktop/unstable/gnome-session/debian/patches/series [utf-8] (original)
+++ desktop/unstable/gnome-session/debian/patches/series [utf-8] Thu Mar 25 19:01:29 2010
@@ -3,4 +3,6 @@
 10_session_save.patch
 11_saved_session_name.patch
 12_no_gdm_fallback.patch
+13_capplet_always_save.patch
+14_crash_on_exit.patch
 90_relibtoolize.patch




More information about the pkg-gnome-commits mailing list