[gdm] Queue updating the selection in the user list
- From: William Jon McCann <mccann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdm] Queue updating the selection in the user list
- Date: Fri, 11 Jun 2010 00:19:45 +0000 (UTC)
commit 70b622ac8afda7aeed7604d822628c17c51e3ffb
Author: William Jon McCann <jmccann redhat com>
Date: Tue Jun 8 17:13:51 2010 -0400
Queue updating the selection in the user list
https://bugzilla.gnome.org/show_bug.cgi?id=621045
gui/simple-greeter/gdm-chooser-widget.c | 24 +++++++++++++++++++++---
1 files changed, 21 insertions(+), 3 deletions(-)
---
diff --git a/gui/simple-greeter/gdm-chooser-widget.c b/gui/simple-greeter/gdm-chooser-widget.c
index 0a86349..64e613e 100644
--- a/gui/simple-greeter/gdm-chooser-widget.c
+++ b/gui/simple-greeter/gdm-chooser-widget.c
@@ -88,6 +88,7 @@ struct GdmChooserWidgetPrivate
gint number_of_active_timers;
guint update_idle_id;
+ guint update_cursor_idle_id;
guint update_visibility_idle_id;
guint timer_animation_timeout_id;
@@ -914,7 +915,7 @@ gdm_chooser_widget_grow (GdmChooserWidget *widget)
}
}
-static void
+static gboolean
move_cursor_to_top (GdmChooserWidget *widget)
{
GtkTreeModel *model;
@@ -930,6 +931,9 @@ move_cursor_to_top (GdmChooserWidget *widget)
FALSE);
}
gtk_tree_path_free (path);
+
+ widget->priv->update_cursor_idle_id = 0;
+ return FALSE;
}
static gboolean
@@ -1159,6 +1163,11 @@ gdm_chooser_widget_dispose (GObject *object)
widget->priv->update_visibility_idle_id = 0;
}
+ if (widget->priv->update_cursor_idle_id > 0) {
+ g_source_remove (widget->priv->update_cursor_idle_id);
+ widget->priv->update_cursor_idle_id = 0;
+ }
+
if (widget->priv->separator_row != NULL) {
gtk_tree_row_reference_free (widget->priv->separator_row);
widget->priv->separator_row = NULL;
@@ -2053,6 +2062,15 @@ queue_update_chooser_visibility (GdmChooserWidget *widget)
}
}
+static void
+queue_move_cursor_to_top (GdmChooserWidget *widget)
+{
+ if (widget->priv->update_cursor_idle_id == 0) {
+ widget->priv->update_cursor_idle_id =
+ g_idle_add ((GSourceFunc) move_cursor_to_top, widget);
+ }
+}
+
void
gdm_chooser_widget_add_item (GdmChooserWidget *widget,
const char *id,
@@ -2098,7 +2116,7 @@ gdm_chooser_widget_add_item (GdmChooserWidget *widget,
CHOOSER_ID_COLUMN, id,
-1);
- move_cursor_to_top (widget);
+ queue_move_cursor_to_top (widget);
queue_update_chooser_visibility (widget);
}
@@ -2147,7 +2165,7 @@ gdm_chooser_widget_remove_item (GdmChooserWidget *widget,
gtk_list_store_remove (widget->priv->list_store, &iter);
- move_cursor_to_top (widget);
+ queue_move_cursor_to_top (widget);
queue_update_chooser_visibility (widget);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]