[gnome-shell] main: grab the keyboard D-Bus interface at startup



commit 98fa71ba187502f25161cb9ae2ac49fe9a96d2be
Author: Dan Winship <danw gnome org>
Date:   Fri Sep 2 11:28:47 2011 -0400

    main: grab the keyboard D-Bus interface at startup
    
    https://bugzilla.gnome.org/show_bug.cgi?id=658065

 js/ui/keyboard.js |    1 -
 src/main.c        |   11 +++++++++++
 2 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index e6d56b7..7742788 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -199,7 +199,6 @@ function Keyboard() {
 Keyboard.prototype = {
     _init: function () {
         DBus.session.exportObject('/org/gnome/Caribou/Keyboard', this);
-        DBus.session.acquire_name('org.gnome.Caribou.Keyboard', 0, null, null);
 
         this._timestamp = global.get_current_time();
         this.actor = new St.BoxLayout({ name: 'keyboard', vertical: true, reactive: true });
diff --git a/src/main.c b/src/main.c
index 23c33a5..7c68799 100644
--- a/src/main.c
+++ b/src/main.c
@@ -117,6 +117,17 @@ shell_dbus_init (gboolean replace)
       g_print ("failed to acquire org.freedesktop.Notifications: %s\n", error->message);
     }
 
+  /* ...and the on-screen keyboard service */
+  if (!dbus_g_proxy_call (bus, "RequestName", &error,
+                          G_TYPE_STRING, "org.gnome.Caribou.Keyboard",
+                          G_TYPE_UINT, DBUS_NAME_FLAG_REPLACE_EXISTING | request_name_flags,
+                          G_TYPE_INVALID,
+                          G_TYPE_UINT, &request_name_result,
+                          G_TYPE_INVALID))
+    {
+      g_print ("failed to acquire org.freedesktop.Notifications: %s\n", error->message);
+    }
+
   g_object_unref (bus);
 }
 



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