[gnome-flashback] input-sources: don't show status icon when not needed



commit d24da06a369984a48c16725a0af9f5bfd3bd12f3
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Thu Oct 15 05:38:44 2015 +0300

    input-sources: don't show status icon when not needed

 .../libinput-sources/gf-input-sources.c            |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/gnome-flashback/libinput-sources/gf-input-sources.c 
b/gnome-flashback/libinput-sources/gf-input-sources.c
index 0632d2c..0f18884 100644
--- a/gnome-flashback/libinput-sources/gf-input-sources.c
+++ b/gnome-flashback/libinput-sources/gf-input-sources.c
@@ -185,6 +185,7 @@ update_status_icon (GfInputSources *sources)
 {
   GfInputSourceManager *manager;
   GfInputSource *source;
+  GList *input_sources;
   const gchar *display_name;
 
   manager = sources->input_source_manager;
@@ -198,6 +199,18 @@ update_status_icon (GfInputSources *sources)
       return;
     }
 
+  input_sources = gf_input_source_manager_get_input_sources (manager);
+
+  if (g_list_length (input_sources) < 2)
+    {
+      g_list_free (input_sources);
+      return;
+    }
+  else
+    {
+      g_list_free (input_sources);
+    }
+
   sources->current_source = g_object_ref (source);
 
   if (sources->status_icon == NULL)
@@ -222,6 +235,11 @@ static void
 sources_changed_cb (GfInputSourceManager *manager,
                     gpointer              user_data)
 {
+  GfInputSources *sources;
+
+  sources = GF_INPUT_SOURCES (user_data);
+
+  update_status_icon (sources);
 }
 
 static void


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