gnome-session r5174 - in trunk: . gnome-session



Author: lucasr
Date: Tue Jan  6 02:13:54 2009
New Revision: 5174
URL: http://svn.gnome.org/viewvc/gnome-session?rev=5174&view=rev

Log:
2009-01-06  Lucas Rocha  <lucasr gnome org>

	Bug 563640 â In all phases before APPLICATION, consider process
	termination as completion

	Most clients register using the session protocol. But it's perfectly
	fine if a client simply exits upon completion, or forks and exits in
	the parent when ready.  This is indeed how we were treating phase
	INITIALIZATION.  There is no reason to not treat other non-APPLICATION
	phases that way.  The default clients for those phases (gnome-panel,
	metacity, nautilus) register to the session, but for example,
	libcanberra installed a script for phase DESKTOP to play login sound,
	and since it doesn't connect to the session, gnome-session was
	timeout'ing for that phase.

	* gnome-session/gsm-manager.c (on_app_exited, _start_app): ditto.
	Patch by Behdad Esfahbod.

Modified:
   trunk/ChangeLog
   trunk/gnome-session/README
   trunk/gnome-session/gsm-manager.c

Modified: trunk/gnome-session/README
==============================================================================
--- trunk/gnome-session/README	(original)
+++ trunk/gnome-session/README	Tue Jan  6 02:13:54 2009
@@ -45,9 +45,7 @@
 When apps connect to the XSMP or D-Bus servers, GsmClients are created
 and added to the session. The session tries to map these clients to
 GsmApps. GsmApps signal when they register (via XSMP or SN) or exit,
-and GsmSession uses this to decide when the phase is complete. (NOTE:
-THE GsmClient->GsmApp MAPPING ISN'T WRITTEN YET. PHASES CAN CURRENTLY
-ONLY END BY TIMING OUT.)
+and GsmSession uses this to decide when the phase is complete.
 
 FIXME: after starting the session, we need to run the DiscardCommands
 of resumed apps.

Modified: trunk/gnome-session/gsm-manager.c
==============================================================================
--- trunk/gnome-session/gsm-manager.c	(original)
+++ trunk/gnome-session/gsm-manager.c	Tue Jan  6 02:13:54 2009
@@ -418,18 +418,6 @@
         return FALSE;
 }
 
-static void
-on_app_exited (GsmApp     *app,
-               GsmManager *manager)
-{
-        if (manager->priv->phase == GSM_MANAGER_PHASE_INITIALIZATION) {
-                /* Applications from Initialization phase are considered
-                 * registered when they exit normally. This is because
-                 * they are expected to just do "something" and exit */
-                app_registered (app, manager);
-        }
-}
-
 static gboolean
 _start_app (const char *id,
             GsmApp     *app,
@@ -468,13 +456,12 @@
                 goto out;
         }
 
-        g_signal_connect (app,
-                          "exited",
-                          G_CALLBACK (on_app_exited),
-                          manager);
-
         if (manager->priv->phase < GSM_MANAGER_PHASE_APPLICATION) {
                 g_signal_connect (app,
+                                  "exited",
+                                  G_CALLBACK (app_registered),
+                                  manager);
+                g_signal_connect (app,
                                   "registered",
                                   G_CALLBACK (app_registered),
                                   manager);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]