[gnome-initial-setup/shell/4765: 337/362] input-chooser: sort default layout before others



commit 381c3198ce8d7169184fef7ff9cf3010d039c09b
Author: Cosimo Cecchi <cosimo endlessm com>
Date:   Fri Feb 6 16:10:59 2015 -0800

    input-chooser: sort default layout before others

 .../pages/keyboard/cc-input-chooser.c              |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/gnome-initial-setup/pages/keyboard/cc-input-chooser.c 
b/gnome-initial-setup/pages/keyboard/cc-input-chooser.c
index 83aa4ce..065b890 100644
--- a/gnome-initial-setup/pages/keyboard/cc-input-chooser.c
+++ b/gnome-initial-setup/pages/keyboard/cc-input-chooser.c
@@ -436,6 +436,8 @@ sort_inputs (GtkListBoxRow *a,
                 gpointer       data)
 {
         InputWidget *la, *lb;
+        CcInputChooser *chooser = data;
+        CcInputChooserPrivate *priv = cc_input_chooser_get_instance_private (chooser);
 
         la = get_input_widget (gtk_bin_get_child (GTK_BIN (a)));
         lb = get_input_widget (gtk_bin_get_child (GTK_BIN (b)));
@@ -446,6 +448,12 @@ sort_inputs (GtkListBoxRow *a,
         if (lb == NULL)
                 return -1;
 
+       if (g_strcmp0 (priv->id, la->id) == 0)
+               return -1;
+
+       if (g_strcmp0 (priv->id, lb->id) == 0)
+               return 1;
+
         if (la->is_extra && !lb->is_extra)
                 return 1;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]