[gnome-initial-setup/wip/pwithnall/misc-fixes: 21/70] input-chooser: sort default layout before others




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

    input-chooser: sort default layout before others
    
    (Rebase 3.38: This could potentially be dropped in future if we update
    cc-input-chooser.c from gnome-control-center; it’s copy/paste code.)

 gnome-initial-setup/pages/keyboard/cc-input-chooser.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/gnome-initial-setup/pages/keyboard/cc-input-chooser.c 
b/gnome-initial-setup/pages/keyboard/cc-input-chooser.c
index 196abf69..d1bc25c7 100644
--- a/gnome-initial-setup/pages/keyboard/cc-input-chooser.c
+++ b/gnome-initial-setup/pages/keyboard/cc-input-chooser.c
@@ -470,6 +470,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)));
@@ -480,6 +482,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]