[gnome-control-center] region: Search default input sources



commit 5c0f6e1cdee980628d2274fba2f8716dd54ab442
Author: Takao Fujiwara <tfujiwar redhat com>
Date:   Fri Sep 18 07:48:16 2020 +0900

    region: Search default input sources
    
    The default input sources are not included in layout_rows_by_id or
    engine_rows_by_id but in default_input_source_row of GtkListBoxRow.
    
    https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1131

 panels/region/cc-input-chooser.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
---
diff --git a/panels/region/cc-input-chooser.c b/panels/region/cc-input-chooser.c
index 74c8e0ca4..7ad59fd0b 100644
--- a/panels/region/cc-input-chooser.c
+++ b/panels/region/cc-input-chooser.c
@@ -466,6 +466,17 @@ match_all (gchar       **words,
   return TRUE;
 }
 
+static gboolean
+match_default_source_in_table (gchar         **words,
+                               GtkListBoxRow  *row)
+{
+  const gchar *source_name;
+  source_name = g_object_get_data (G_OBJECT (row), "unaccented-name");
+  if (source_name && match_all (words, source_name))
+    return TRUE;
+  return FALSE;
+}
+
 static gboolean
 match_source_in_table (gchar      **words,
                        GHashTable  *table)
@@ -523,6 +534,11 @@ list_filter (GtkListBoxRow *row,
     }
   else
     {
+      if (info->default_input_source_row &&
+          match_default_source_in_table (self->filter_words, info->default_input_source_row))
+        {
+          return TRUE;
+        }
       if (match_source_in_table (self->filter_words, info->layout_rows_by_id))
         return TRUE;
       if (match_source_in_table (self->filter_words, info->engine_rows_by_id))


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