gdm r6175 - in trunk: . gui/user-switch-applet
- From: mccann svn gnome org
- To: svn-commits-list gnome org
- Subject: gdm r6175 - in trunk: . gui/user-switch-applet
- Date: Mon, 28 Apr 2008 21:19:27 +0100 (BST)
Author: mccann
Date: Mon Apr 28 20:19:27 2008
New Revision: 6175
URL: http://svn.gnome.org/viewvc/gdm?rev=6175&view=rev
Log:
2008-04-28 William Jon McCann <jmccann redhat com>
* gui/user-switch-applet/applet.c: (update_user_item_visibility),
(on_user_sessions_changed), (add_user), (on_manager_user_added),
(on_manager_user_is_logged_in_changed), (fill_applet):
Make sure we update the visibility of hidden items
once those users actually log in.
Modified:
trunk/ChangeLog
trunk/gui/user-switch-applet/applet.c
Modified: trunk/gui/user-switch-applet/applet.c
==============================================================================
--- trunk/gui/user-switch-applet/applet.c (original)
+++ trunk/gui/user-switch-applet/applet.c Mon Apr 28 20:19:27 2008
@@ -859,12 +859,12 @@
}
static void
-user_sessions_changed_cb (GdmUser *user,
- GdmAppletData *adata)
+update_user_item_visibility (GdmAppletData *adata,
+ GdmUser *user)
{
GtkWidget *menuitem;
- g_debug ("Sessions changed for %s", gdm_user_get_user_name (user));
+ g_debug ("Updating menu item visibility for %s", gdm_user_get_user_name (user));
menuitem = g_object_get_qdata (G_OBJECT (user), adata->user_menu_item_quark);
if (menuitem == NULL) {
@@ -890,6 +890,14 @@
}
static void
+on_user_sessions_changed (GdmUser *user,
+ GdmAppletData *adata)
+{
+ g_debug ("Sessions changed for %s", gdm_user_get_user_name (user));
+ update_user_item_visibility (adata, user);
+}
+
+static void
add_user (GdmAppletData *adata,
GdmUser *user)
{
@@ -916,36 +924,27 @@
g_signal_connect (user,
"sessions-changed",
- G_CALLBACK (user_sessions_changed_cb),
+ G_CALLBACK (on_user_sessions_changed),
adata);
}
-static gboolean
-maybe_add_user (GdmAppletData *adata,
- GdmUser *user)
+static void
+on_manager_user_added (GdmUserManager *manager,
+ GdmUser *user,
+ GdmAppletData *adata)
{
- if (adata->active_only) {
- guint num_sessions;
-
- num_sessions = gdm_user_get_num_sessions (user);
- if (num_sessions < 1) {
- return FALSE;
- }
- }
-
add_user (adata, user);
-
- return TRUE;
+ update_user_item_visibility (adata, user);
+ sort_menu (adata);
}
static void
-manager_user_added_cb (GdmUserManager *manager,
- GdmUser *user,
- GdmAppletData *adata)
+on_manager_user_is_logged_in_changed (GdmUserManager *manager,
+ GdmUser *user,
+ GdmAppletData *adata)
{
- if (maybe_add_user (adata, user)) {
- sort_menu (adata);
- }
+ update_user_item_visibility (adata, user);
+ sort_menu (adata);
}
static void
@@ -1206,14 +1205,19 @@
*/
users = gdm_user_manager_list_users (adata->manager);
while (users != NULL) {
- maybe_add_user (adata, users->data);
+ add_user (adata, users->data);
+ update_user_item_visibility (adata, users->data);
users = g_slist_delete_link (users, users);
}
g_signal_connect (adata->manager,
"user-added",
- G_CALLBACK (manager_user_added_cb),
+ G_CALLBACK (on_manager_user_added),
+ adata);
+ g_signal_connect (adata->manager,
+ "user-is-logged-in-changed",
+ G_CALLBACK (on_manager_user_is_logged_in_changed),
adata);
adata->separator_item = gtk_separator_menu_item_new ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]