diff options
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | debian/changelog | 10 | ||||
-rw-r--r-- | src/gtk-dialog/logout-dialog.c | 4 | ||||
-rw-r--r-- | src/indicator-session.c | 27 | ||||
-rw-r--r-- | src/users-service-dbus.h | 5 | ||||
-rw-r--r-- | src/users-service.c | 28 |
6 files changed, 69 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac index 0ce9fbc..193e88c 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ AC_INIT(src/indicator-session.c) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-session, 0.1.5) +AM_INIT_AUTOMAKE(indicator-session, 0.1.6) AM_MAINTAINER_MODE diff --git a/debian/changelog b/debian/changelog index 7f5fb23..6b4d9b0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +indicator-session (0.1.6-0ubuntu1) UNRELEASED; urgency=low + + * Upstream release 0.1.6 (LP: #440216) + * Making startup of services asynchronous (LP: #436181) + * Disabling "Lock Screen" item when action is blocked by + GDM autologin (LP: #436724) + * Disabling "Lock Screen" in guest session (LP: #439068) + + -- Ted Gould <ted@ubuntu.com> Thu, 01 Oct 2009 15:26:19 -0500 + indicator-session (0.1.5-0ubuntu2) karmic; urgency=low * src/indicator-session.c: diff --git a/src/gtk-dialog/logout-dialog.c b/src/gtk-dialog/logout-dialog.c index a94c649..c53590e 100644 --- a/src/gtk-dialog/logout-dialog.c +++ b/src/gtk-dialog/logout-dialog.c @@ -275,7 +275,9 @@ logout_dialog_init (LogoutDialog *logout_dialog) gtk_window_stick(GTK_WINDOW(logout_dialog)); gtk_window_set_keep_above(GTK_WINDOW(logout_dialog), TRUE); gtk_widget_realize(GTK_WIDGET(logout_dialog)); - gdk_window_set_functions(GTK_WIDGET(logout_dialog)->window, GDK_FUNC_CLOSE); + /* remove superfluous window buttons */ + gdk_window_set_functions (GTK_WIDGET(logout_dialog)->window, 0); + gdk_window_set_decorations (GTK_WIDGET(logout_dialog)->window, GDK_DECOR_BORDER | GDK_DECOR_TITLE); /* center window */ gtk_window_set_position (GTK_WINDOW(logout_dialog), GTK_WIN_POS_CENTER); 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); diff --git a/src/users-service-dbus.h b/src/users-service-dbus.h index fc14beb..9ba05c9 100644 --- a/src/users-service-dbus.h +++ b/src/users-service-dbus.h @@ -50,8 +50,11 @@ struct _UserData UsersServiceDbus *service; }; +/* XXX - MAXIMUM_USERS should be set to 7 once we've + * got some gdm issues worked out. + */ #define MINIMUM_USERS 1 -#define MAXIMUM_USERS 7 +#define MAXIMUM_USERS 1 struct _UsersServiceDbus { GObject parent; diff --git a/src/users-service.c b/src/users-service.c index dc11e8d..9877ba6 100644 --- a/src/users-service.c +++ b/src/users-service.c @@ -53,6 +53,9 @@ static DbusmenuMenuitem *root_menuitem = NULL; static GMainLoop *mainloop = NULL; static UsersServiceDbus *dbus_interface = NULL; +static DbusmenuMenuitem *lock_menuitem = NULL; +static gboolean is_guest = FALSE; + static DBusGProxy * gdm_settings_proxy = NULL; static gboolean gdm_auto_login = FALSE; static const gchar * gdm_auto_login_string = "daemon/AutomaticLoginEnable"; @@ -78,6 +81,14 @@ gdm_settings_change (DBusGProxy * proxy, const gchar * value, const gchar * old, gdm_auto_login = FALSE; } + if (lock_menuitem != NULL) { + if (gdm_auto_login || is_guest) { + dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_SENSITIVE, "false"); + } else { + dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_SENSITIVE, "true"); + } + } + return; } @@ -277,10 +288,15 @@ rebuild_items (DbusmenuMenuitem *root, g_list_foreach (children, (GFunc)g_object_unref, NULL); g_list_free (children); - mi = dbusmenu_menuitem_new(); - dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Lock Screen")); - g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(lock_screen), NULL); - dbusmenu_menuitem_child_append(root, mi); + lock_menuitem = dbusmenu_menuitem_new(); + dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _("Lock Screen")); + g_signal_connect(G_OBJECT(lock_menuitem), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(lock_screen), NULL); + dbusmenu_menuitem_child_append(root, lock_menuitem); + if (gdm_auto_login || is_guest) { + dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_SENSITIVE, "false"); + } else { + dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_SENSITIVE, "true"); + } if (can_activate == TRUE) { @@ -394,6 +410,10 @@ main (int argc, char ** argv) return 1; } + if (!g_strcmp0(g_get_user_name(), "guest")) { + is_guest = TRUE; + } + g_idle_add(build_gdm_proxy, NULL); dbus_interface = g_object_new (USERS_SERVICE_DBUS_TYPE, NULL); |