summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2009-10-09 11:26:06 -0400
committerRay Strode <rstrode@redhat.com>2009-10-09 11:26:06 -0400
commitd56eaae13ba731ff9837ee37cac9165fff99f350 (patch)
tree29d85a18d126d273763d7f0733126d5d48241246
parent5948d9eb0df6c2b4013b92ecf206500cc91ac430 (diff)
downloadgdm-d56eaae13ba731ff9837ee37cac9165fff99f350.tar.gz
Fix Other... user visibility check
Before we'd only add the Other item if the number of users was 1, when we should have been adding it if the number of users is greater than or equal to 1. This is because in some cases more than one item can get added to the user list before the visibility function is run.
-rw-r--r--gui/simple-greeter/gdm-user-chooser-widget.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/gui/simple-greeter/gdm-user-chooser-widget.c b/gui/simple-greeter/gdm-user-chooser-widget.c
index 4410a02e..167e3246 100644
--- a/gui/simple-greeter/gdm-user-chooser-widget.c
+++ b/gui/simple-greeter/gdm-user-chooser-widget.c
@@ -130,6 +130,8 @@ get_icon_height_for_widget (GtkWidget *widget)
static void
update_other_user_visibility (GdmUserChooserWidget *widget)
{
+ int number_of_users;
+
if (!widget->priv->show_user_other) {
if (widget->priv->has_user_other) {
remove_user_other (widget);
@@ -138,14 +140,14 @@ update_other_user_visibility (GdmUserChooserWidget *widget)
return;
}
- if (gdm_chooser_widget_get_number_of_items (GDM_CHOOSER_WIDGET (widget)) == 1) {
- /* we hide the Other user if it's the last one, and we show it
- * if there's another user */
- if (widget->priv->has_user_other) {
- remove_user_other (widget);
- } else {
- add_user_other (widget);
- }
+ number_of_users = gdm_chooser_widget_get_number_of_items (GDM_CHOOSER_WIDGET (widget));
+
+ /* we hide the Other user if it's the last one, and we show it
+ * if there's another user */
+ if (number_of_users == 1 && widget->priv->has_user_other) {
+ remove_user_other (widget);
+ } if (number_of_users >= 1 && !widget->priv->has_user_other) {
+ add_user_other (widget);
}
}