Blob Blame History Raw
From f255365b287104f202d8a6d3eb0419cf28579fa8 Mon Sep 17 00:00:00 2001
From: Daiki Ueno <dueno@src.gnome.org>
Date: Fri, 5 Sep 2014 11:04:46 +0900
Subject: [PATCH] daemon: Make "Run" D-Bus method no-op

Add a separate method for D-Bus activation, instead of checking
multiple invocation in Daemon.run().

https://bugzilla.gnome.org/show_bug.cgi?id=683712
---
 daemon/daemon.vala | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/daemon/daemon.vala b/daemon/daemon.vala
index 82b2c3f..ca80799 100644
--- a/daemon/daemon.vala
+++ b/daemon/daemon.vala
@@ -162,14 +162,13 @@ namespace Caribou {
                 on_text_caret_moved_ignore_error, "object:text-caret-moved");
         }
 
+        [DBus (name = "Run")]
+        public void ping () {
+            // This method is called over D-Bus, upon activation.
+        }
+
+        [DBus (visible = false)]
         public void run () {
-            if (keyboard != null)
-            {
-                // This method is available over D-Bus, so ignore the request
-                // to run if the daemon is already running.
-                return;
-            }
-
             Bus.get_proxy.begin<_Keyboard> (BusType.SESSION,
                                             "org.gnome.Caribou.Keyboard",
                                             "/org/gnome/Caribou/Keyboard",
-- 
2.1.0