[at-spi2-core] Fix for BGO#643454: Kill the accessibility bus daemon with the GNOME session



commit 6078fc95fc8a3c223af84375dcd75edf0c30e804
Author: Mike Gorse <mgorse novell com>
Date:   Fri Mar 4 13:53:31 2011 -0600

    Fix for BGO#643454: Kill the accessibility bus daemon with the GNOME session

 bus/at-spi-dbus-bus.in    |    2 +-
 registryd/registry-main.c |   29 +++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletions(-)
---
diff --git a/bus/at-spi-dbus-bus.in b/bus/at-spi-dbus-bus.in
index 9b2fede..af92d25 100644
--- a/bus/at-spi-dbus-bus.in
+++ b/bus/at-spi-dbus-bus.in
@@ -9,5 +9,5 @@ if [ "$var" == "true" ]; then
   exit 0
 fi
 
-address=`${dbusdaemon} --config-file=${sysconfdir}/at-spi2/accessibility.conf --print-address`
+address=`${dbusdaemon} --config-file=${sysconfdir}/at-spi2/accessibility.conf --print-address 1 --print-pid 2 2>$HOME/.at-spi-dbus-bus.pid`
 xprop -root -f AT_SPI_BUS 8s -set AT_SPI_BUS ${address}
diff --git a/registryd/registry-main.c b/registryd/registry-main.c
index b1b5cde..c9c5758 100644
--- a/registryd/registry-main.c
+++ b/registryd/registry-main.c
@@ -88,8 +88,36 @@ session_manager_connect (void)
 }
 
 static void
+kill_accessibility_bus ()
+{
+  FILE *fp;
+  const char *home;
+  char *name;
+  int pid;
+
+  home = getenv ("HOME");
+  if (!home)
+    return;
+  name = g_strconcat (home, "/", ".atspi-dbus-bus.pid");
+  if (!name)
+    return;
+
+  fp = fopen (name, "r");
+  if (fp)
+  {
+    if (fscanf (fp, "%d", &pid) == 1)
+    {
+      kill (&pid, SIGTERM);
+    }
+    fclose (fp);
+  }
+  g_free (name);
+}
+
+static void
 stop_cb (gpointer data)
 {
+        kill_accessibility_bus ();
         g_main_loop_quit (mainloop);
 }
 
@@ -123,6 +151,7 @@ query_end_session_cb (guint flags, gpointer data)
 static void
 end_session_cb (guint flags, gpointer data)
 {
+        kill_accessibility_bus ();
         end_session_response (TRUE, NULL);
         g_main_loop_quit (mainloop);
 }



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