File lightdm-gtk-greeter-fix-ui.patch of Package lightdm-gtk-greeter

Index: lightdm-gtk-greeter-1.3.1/data/greeter.ui
===================================================================
--- lightdm-gtk-greeter-1.3.1.orig/data/greeter.ui
+++ lightdm-gtk-greeter-1.3.1/data/greeter.ui
@@ -16,12 +16,13 @@
     <property name="decorated">False</property>
     <property name="has_resize_grip">False</property>
     <child>
-      <object class="GtkNotebook" id="login_notebook">
-        <property name="name">login_notebook</property>
-        <property name="width_request">400</property>
+      <object class="GtkFrame" id="login_frame">
+        <property name="name">login_frame</property>
+        <property name="width_request">550</property>
+        <property name="height_request">250</property>
         <property name="visible">True</property>
-        <property name="can_focus">True</property>
-        <property name="show_tabs">False</property>
+        <property name="can_focus">False</property>
+        <property name="shadow_type">out</property>
         <child>
           <object class="GtkVBox" id="vbox2">
             <property name="name">vbox2</property>
@@ -51,17 +52,32 @@
                 <property name="label" comments="This is a placeholder string and will be replaced with the hostname of the system">[hostname]</property>
               </object>
               <packing>
-                <property name="expand">True</property>
+                <property name="expand">False</property>
                 <property name="fill">True</property>
                 <property name="position">1</property>
               </packing>
             </child>
             <child>
-              <object class="GtkComboBox" id="user_combobox">
-                <property name="name">user_combobox</property>
+              <object class="GtkScrolledWindow" id="user_scrolledwindow">
+                <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="model">user_liststore</property>
-                <signal name="changed" handler="user_combobox_active_changed_cb" swapped="no"/>
+                <property name="hscrollbar_policy">automatic</property>
+                <property name="vscrollbar_policy">automatic</property>
+                <property name="shadow_type">etched-in</property>
+                <child>
+                  <object class="GtkTreeView" id="user_treeview">
+                    <property name="name">user_treeview</property>
+                    <property name="can_focus">True</property>
+                    <property name="model">user_liststore</property>
+                    <property name="headers_visible">False</property>
+                    <property name="fixed_height_mode">True</property>
+                    <child internal-child="selection">
+                      <object class="GtkTreeSelection" id="treeview-selection1">
+                        <signal name="changed" handler="user_treeview_selection_changed_cb" swapped="no"/>
+                      </object>
+                    </child>
+                  </object>
+                </child>
               </object>
               <packing>
                 <property name="expand">True</property>
@@ -110,7 +126,7 @@
                     </child>
                   </object>
                   <packing>
-                    <property name="expand">True</property>
+                    <property name="expand">False</property>
                     <property name="fill">True</property>
                     <property name="position">0</property>
                   </packing>
@@ -140,7 +156,7 @@
                         <property name="model">session_liststore</property>
                       </object>
                       <packing>
-                        <property name="expand">True</property>
+                        <property name="expand">False</property>
                         <property name="fill">True</property>
                         <property name="position">0</property>
                       </packing>
@@ -152,7 +168,7 @@
                         <property name="model">language_liststore</property>
                       </object>
                       <packing>
-                        <property name="expand">True</property>
+                        <property name="expand">False</property>
                         <property name="fill">True</property>
                         <property name="position">1</property>
                       </packing>
@@ -193,7 +209,7 @@
                     </child>
                   </object>
                   <packing>
-                    <property name="expand">True</property>
+                    <property name="expand">False</property>
                     <property name="fill">True</property>
                     <property name="position">2</property>
                   </packing>
@@ -207,9 +223,6 @@
             </child>
           </object>
         </child>
-        <child type="tab">
-          <placeholder/>
-        </child>
       </object>
     </child>
   </object>
Index: lightdm-gtk-greeter-1.3.1/src/lightdm-gtk-greeter.c
===================================================================
--- lightdm-gtk-greeter-1.3.1.orig/src/lightdm-gtk-greeter.c
+++ lightdm-gtk-greeter-1.3.1/src/lightdm-gtk-greeter.c
@@ -26,9 +26,9 @@ static gchar *state_filename;
 static GtkWindow *login_window, *panel_window;
 static GtkButton *login_button, *cancel_button;
 static GtkLabel *message_label, *prompt_label;
+static GtkTreeView *user_view;
 static GtkWidget *login_box, *prompt_box;
 static GtkEntry *prompt_entry;
-static GtkComboBox *user_combo;
 static GtkComboBox *session_combo;
 static GtkComboBox *language_combo;
 static gchar *default_font_name, *default_theme_name, *default_icon_theme_name;
@@ -220,6 +220,7 @@ static void
 cancel_authentication (void)
 {
     GtkTreeModel *model;
+    GtkTreeSelection *selection;
     GtkTreeIter iter;
     gboolean other = FALSE;
 
@@ -233,9 +234,9 @@ cancel_authentication (void)
     }
 
     /* Force refreshing the prompt_box for "Other" */
-    model = gtk_combo_box_get_model (user_combo);
-
-    if (gtk_combo_box_get_active_iter (user_combo, &iter))
+    selection = gtk_tree_view_get_selection (user_view);
+    model = gtk_tree_view_get_model (user_view);
+    if (gtk_tree_selection_get_selected (selection, &model, &iter))
     {
         gchar *user;
 
@@ -248,7 +249,7 @@ cancel_authentication (void)
     if (other || lightdm_greeter_get_hide_users_hint (greeter))
         start_authentication ("*other");
     else
-        gtk_widget_grab_focus (GTK_WIDGET (user_combo));
+        gtk_widget_grab_focus (GTK_WIDGET (user_view));
 }
 
 static void
@@ -291,17 +292,15 @@ start_session (void)
     g_free (session);
 }
 
-void user_combobox_active_changed_cb (GtkComboBox *widget, LightDMGreeter *greeter);
+void user_treeview_selection_changed_cb (GtkTreeSelection *selection);
 G_MODULE_EXPORT
 void
-user_combobox_active_changed_cb (GtkComboBox *widget, LightDMGreeter *greeter)
+user_treeview_selection_changed_cb (GtkTreeSelection *selection)
 {
     GtkTreeModel *model;
     GtkTreeIter iter;
 
-    model = gtk_combo_box_get_model (user_combo);
-
-    if (gtk_combo_box_get_active_iter (user_combo, &iter))
+    if (gtk_tree_selection_get_selected (selection, &model, &iter))
     {
         gchar *user;
 
@@ -480,7 +479,7 @@ user_added_cb (LightDMUserList *user_lis
     GtkTreeModel *model;
     GtkTreeIter iter;
 
-    model = gtk_combo_box_get_model (user_combo);
+    model = gtk_tree_view_get_model (user_view);
 
     gtk_list_store_append (GTK_LIST_STORE (model), &iter);
     gtk_list_store_set (GTK_LIST_STORE (model), &iter,
@@ -495,7 +494,7 @@ get_user_iter (const gchar *username, Gt
 {
     GtkTreeModel *model;
 
-    model = gtk_combo_box_get_model (user_combo);
+    model = gtk_tree_view_get_model (user_view);
   
     if (!gtk_tree_model_get_iter_first (model, iter))
         return FALSE;
@@ -523,8 +522,7 @@ user_changed_cb (LightDMUserList *user_l
     if (!get_user_iter (lightdm_user_get_name (user), &iter))
         return;
 
-    model = gtk_combo_box_get_model (user_combo);
-
+    model = gtk_tree_view_get_model (user_view);
     gtk_list_store_set (GTK_LIST_STORE (model), &iter,
                         0, lightdm_user_get_name (user),
                         1, lightdm_user_get_display_name (user),
@@ -541,7 +539,7 @@ user_removed_cb (LightDMUserList *user_l
     if (!get_user_iter (lightdm_user_get_name (user), &iter))
         return;
 
-    model = gtk_combo_box_get_model (user_combo);
+    model = gtk_tree_view_get_model (user_view);  
     gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
 }
 
@@ -613,7 +611,7 @@ load_user_list ()
     g_signal_connect (lightdm_user_list_get_instance (), "user-changed", G_CALLBACK (user_changed_cb), NULL);
     g_signal_connect (lightdm_user_list_get_instance (), "user-removed", G_CALLBACK (user_removed_cb), NULL);
 
-    model = gtk_combo_box_get_model (user_combo);
+    model = gtk_tree_view_get_model (user_view);
     items = lightdm_user_list_get_users (lightdm_user_list_get_instance ());
     for (item = items; item; item = item->next)
     {
@@ -665,7 +663,7 @@ load_user_list ()
             g_free (name);
             if (matched)
             {
-                gtk_combo_box_set_active_iter (user_combo, &iter);
+                gtk_tree_selection_select_iter (gtk_tree_view_get_selection (user_view), &iter);
                 set_login_button_label (selected_user);
                 start_authentication (selected_user);
                 break;
@@ -936,7 +934,6 @@ main (int argc, char **argv)
     prompt_label = GTK_LABEL (gtk_builder_get_object (builder, "prompt_label"));
     prompt_entry = GTK_ENTRY (gtk_builder_get_object (builder, "prompt_entry"));
     message_label = GTK_LABEL (gtk_builder_get_object (builder, "message_label"));
-    user_combo = GTK_COMBO_BOX (gtk_builder_get_object (builder, "user_combobox"));
     session_combo = GTK_COMBO_BOX (gtk_builder_get_object (builder, "session_combobox"));
     language_combo = GTK_COMBO_BOX (gtk_builder_get_object (builder, "language_combobox"));  
     panel_window = GTK_WINDOW (gtk_builder_get_object (builder, "panel_window"));
@@ -1053,18 +1050,16 @@ main (int argc, char **argv)
         set_language (NULL);
     }
 
-    renderer = gtk_cell_renderer_text_new();
-    gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (user_combo), renderer, TRUE);
-    gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (user_combo), renderer, "text", 1);
-    gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (user_combo), renderer, "weight", 2);
+    user_view = GTK_TREE_VIEW (gtk_builder_get_object (builder, "user_treeview"));
+    gtk_tree_view_insert_column_with_attributes (user_view, -1, "Name", gtk_cell_renderer_text_new(), "text", 1, "weight", 2, NULL);
 
     if (lightdm_greeter_get_hide_users_hint (greeter))
         start_authentication ("*other");
     else
     {
-        load_user_list ();
         gtk_widget_hide (GTK_WIDGET (cancel_button));
-        gtk_widget_show (GTK_WIDGET (user_combo));
+        load_user_list ();
+        gtk_widget_show (GTK_WIDGET (user_view));
     } 
 
     gtk_builder_connect_signals(builder, greeter);