aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog24
-rw-r--r--src/indicator-session.c27
2 files changed, 37 insertions, 14 deletions
diff --git a/debian/changelog b/debian/changelog
index 7a856db..2ba29f3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,24 +1,20 @@
-indicator-session (0.1.5-0ubuntu1~ppa2~launch3) karmic; urgency=low
+indicator-session (0.1.5-0ubuntu3~ppa1) UNRELEASED; urgency=low
- * Starting *all* the services
+ * Merging in the branch for async startup.
- -- Ted Gould <ted@ubuntu.com> Mon, 28 Sep 2009 15:57:25 -0500
+ -- Ted Gould <ted@ubuntu.com> Mon, 28 Sep 2009 21:01:22 -0500
-indicator-session (0.1.5-0ubuntu1~ppa2~launch2) karmic; urgency=low
+indicator-session (0.1.5-0ubuntu2) karmic; urgency=low
- * Getting a little crazy in here.
+ * src/indicator-session.c:
+ - Changing the start up of the services to be asynchronous, thank Ted Gould
+ (lp: #436181)
- -- Ted Gould <ted@ubuntu.com> Mon, 28 Sep 2009 15:51:25 -0500
+ -- Sebastien Bacher <seb128@ubuntu.com> Tue, 29 Sep 2009 01:25:38 +0200
-indicator-session (0.1.5-0ubuntu1~ppa2~launch1) karmic; urgency=low
+indicator-session (0.1.5-0ubuntu1) karmic; urgency=low
- * Merging in the launch protections.
-
- -- Ted Gould <ted@ubuntu.com> Mon, 28 Sep 2009 14:58:10 -0500
-
-indicator-session (0.1.5-0ubuntu1~ppa1) karmic; urgency=low
-
- * Upstream release 0.1.5
+ * Upstream release 0.1.5 (LP: #436223)
* PolicyKit-1 support (LP: #418643)
* GDM User list support (LP: #422052)
* MissionControl5 support (LP: #427643)
diff --git a/src/indicator-session.c b/src/indicator-session.c
index 64c7bc8..a4bb5e1 100644
--- a/src/indicator-session.c
+++ b/src/indicator-session.c
@@ -269,6 +269,10 @@ connect_to_status (gpointer userdata)
return FALSE;
}
+/* Follow up the service being started by connecting
+ up the DBus Menu Client and creating our separator.
+ Also creates an idle func to connect to the service for
+ getting the icon that we should be using on the panel. */
static void
status_followup (void)
{
@@ -341,6 +345,8 @@ users_menu_root_changed(DbusmenuGtkClient * client, DbusmenuMenuitem * newroot,
return;
}
+/* Follow up the service being started by connecting
+ up the DBus Menu Client and creating our separator. */
static void
users_followup (void)
{
@@ -399,6 +405,8 @@ session_menu_root_changed(DbusmenuGtkClient * client, DbusmenuMenuitem * newroot
return;
}
+/* Follow up the service being started by connecting
+ up the DBus Menu Client. */
static void
session_followup (void)
{
@@ -409,9 +417,15 @@ session_followup (void)
}
/* Base menu stuff */
+
+/* This takes the response to the service starting up.
+ It checks to see if it's started and if so, continues
+ with the follow function for the particular area that
+ it's working in. */
static void
start_service_phase2 (DBusGProxy * proxy, guint status, GError * error, gpointer data)
{
+ /* If we've got an error respond to it */
if (error != NULL) {
g_critical("Starting service has resulted in error.");
g_error_free(error);
@@ -420,6 +434,7 @@ start_service_phase2 (DBusGProxy * proxy, guint status, GError * error, gpointer
return;
}
+ /* If it's not running or we started it, try again */
if (status != DBUS_START_REPLY_SUCCESS && status != DBUS_START_REPLY_ALREADY_RUNNING) {
g_critical("Return value isn't indicative of success: %d", status);
/* Try it all again, we need to get this started! */
@@ -427,6 +442,8 @@ start_service_phase2 (DBusGProxy * proxy, guint status, GError * error, gpointer
return;
}
+ /* Check which part of the menu we're in and do the
+ appropriate follow up from the service being started. */
switch (GPOINTER_TO_INT(data)) {
case STATUS_SECTION:
status_followup();
@@ -445,6 +462,10 @@ start_service_phase2 (DBusGProxy * proxy, guint status, GError * error, gpointer
return;
}
+/* Our idle service starter. It looks at the section that
+ we're doing and then asks async for that service to be
+ started by dbus. Probably not really useful to be in
+ the idle loop as it's so quick, but why not. */
static gboolean
start_service (gpointer userdata)
{
@@ -476,6 +497,9 @@ start_service (gpointer userdata)
return FALSE;
}
+/* Indicator based function to get the menu for the whole
+ applet. This starts up asking for the parts of the menu
+ from the various services. */
GtkMenu *
get_menu (void)
{
@@ -485,10 +509,13 @@ get_menu (void)
g_warning("Unable to get proxy for DBus itself. Seriously.");
}
+ /* Startup in the idle loop */
g_idle_add(start_service, GINT_TO_POINTER(STATUS_SECTION));
g_idle_add(start_service, GINT_TO_POINTER(USERS_SECTION));
g_idle_add(start_service, GINT_TO_POINTER(SESSION_SECTION));
+ /* Build a temp menu incase someone can ask for it
+ before the services start. Fast user! */
main_menu = GTK_MENU(gtk_menu_new());
loading_item = gtk_menu_item_new_with_label("Loading...");
gtk_menu_shell_append(GTK_MENU_SHELL(main_menu), loading_item);