[gnome-control-center] region: Revert "Don't use IBus if running in fallback mode"



commit e0260ac5de221e0829085467ff0305b72fd8e854
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Nov 9 16:01:44 2012 +0100

    region: Revert "Don't use IBus if running in fallback mode"
    
    As the fallback mode is going away. #fallback
    
    This reverts commit 658083fffa95a8787baf734f5b87d1a7e0cff2dc.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=682871
    
    Conflicts:
    	panels/region/gnome-region-panel-input.c

 panels/region/gnome-region-panel-input.c |   45 +++++++----------------------
 1 files changed, 11 insertions(+), 34 deletions(-)
---
diff --git a/panels/region/gnome-region-panel-input.c b/panels/region/gnome-region-panel-input.c
index b3de1a2..0dae99b 100644
--- a/panels/region/gnome-region-panel-input.c
+++ b/panels/region/gnome-region-panel-input.c
@@ -63,7 +63,6 @@ static GtkWidget *input_chooser = NULL; /* weak pointer */
 static IBusBus *ibus = NULL;
 static GHashTable *ibus_engines = NULL;
 static GCancellable *ibus_cancellable = NULL;
-static guint shell_name_watch_id = 0;
 
 static const gchar *supported_ibus_engines[] = {
   /* Simplified Chinese */
@@ -303,11 +302,6 @@ strv_contains (const gchar * const *strv,
 static void
 clear_ibus (void)
 {
-  if (shell_name_watch_id > 0)
-    {
-      g_bus_unwatch_name (shell_name_watch_id);
-      shell_name_watch_id = 0;
-    }
   g_cancellable_cancel (ibus_cancellable);
   g_clear_object (&ibus_cancellable);
   g_clear_pointer (&ibus_engines, g_hash_table_destroy);
@@ -480,26 +474,6 @@ maybe_start_ibus (void)
                                         NULL,
                                         NULL));
 }
-
-static void
-on_shell_appeared (GDBusConnection *connection,
-                   const gchar     *name,
-                   const gchar     *name_owner,
-                   gpointer         data)
-{
-  GtkBuilder *builder = data;
-
-  if (!ibus)
-    {
-      ibus = ibus_bus_new_async ();
-      if (ibus_bus_is_connected (ibus))
-        fetch_ibus_engines (builder);
-      else
-        g_signal_connect_swapped (ibus, "connected",
-                                  G_CALLBACK (fetch_ibus_engines), builder);
-    }
-  maybe_start_ibus ();
-}
 #endif  /* HAVE_IBUS */
 
 static gboolean
@@ -1223,14 +1197,17 @@ setup_input_tabs (GtkBuilder    *builder,
 
 #ifdef HAVE_IBUS
   ibus_init ();
-  shell_name_watch_id = g_bus_watch_name (G_BUS_TYPE_SESSION,
-                                          "org.gnome.Shell",
-                                          G_BUS_NAME_WATCHER_FLAGS_NONE,
-                                          on_shell_appeared,
-                                          NULL,
-                                          builder,
-                                          NULL);
-  g_object_weak_ref (G_OBJECT (builder), (GWeakNotify) clear_ibus, NULL);
+  if (!ibus)
+    {
+      ibus = ibus_bus_new_async ();
+      if (ibus_bus_is_connected (ibus))
+        fetch_ibus_engines (builder);
+      else
+        g_signal_connect_swapped (ibus, "connected",
+                                  G_CALLBACK (fetch_ibus_engines), builder);
+      g_object_weak_ref (G_OBJECT (builder), (GWeakNotify) clear_ibus, NULL);
+    }
+  maybe_start_ibus ();
 #endif
 
   populate_with_active_sources (store);



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