From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QsbUs-0008KD-AS for garchives@archives.gentoo.org; Sun, 14 Aug 2011 14:17:02 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8E2CF21C187; Sun, 14 Aug 2011 14:16:54 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 4D9F921C187 for ; Sun, 14 Aug 2011 14:16:54 +0000 (UTC) Received: from flycatcher.gentoo.org (flycatcher.gentoo.org [81.93.255.6]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8C11D1B404C for ; Sun, 14 Aug 2011 14:16:53 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 2240) id 5371520051; Sun, 14 Aug 2011 14:16:52 +0000 (UTC) From: "Nirbheek Chauhan (nirbheek)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, nirbheek@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in app-accessibility/at-spi2-core/files: at-spi2-core-2.0.2-abort-if-already-running.patch at-spi2-core-2.0.2-disable-teamspaces-test.patch X-VCS-Repository: gentoo-x86 X-VCS-Files: at-spi2-core-2.0.2-abort-if-already-running.patch at-spi2-core-2.0.2-disable-teamspaces-test.patch X-VCS-Directories: app-accessibility/at-spi2-core/files X-VCS-Committer: nirbheek X-VCS-Committer-Name: Nirbheek Chauhan Content-Type: text/plain; charset=utf8 Message-Id: <20110814141652.5371520051@flycatcher.gentoo.org> Date: Sun, 14 Aug 2011 14:16:52 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 94a78f68e93a855313224155878918d3 nirbheek 11/08/14 14:16:52 Added: at-spi2-core-2.0.2-abort-if-already-running.patch at-spi2-core-2.0.2-disable-teamspaces-test.patch Log: Move from gnome overlay for GNOME 3 =20 (Portage version: 2.2.0_alpha39_p14/cvs/Linux x86_64) Revision Changes Path 1.1 app-accessibility/at-spi2-core/files/at-spi2-core-2.= 0.2-abort-if-already-running.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-accessibility/= at-spi2-core/files/at-spi2-core-2.0.2-abort-if-already-running.patch?rev=3D= 1.1&view=3Dmarkup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-accessibility/= at-spi2-core/files/at-spi2-core-2.0.2-abort-if-already-running.patch?rev=3D= 1.1&content-type=3Dtext/plain Index: at-spi2-core-2.0.2-abort-if-already-running.patch =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >From 72b5b5733841657af00f31370d26bdfd5a0b60b7 Mon Sep 17 00:00:00 2001 From: Mike Gorse Date: Thu, 09 Jun 2011 16:50:58 +0000 Subject: Make the bus launcher abort if an instance is already running Upon starting up, at-spi-bus-launcher now looks for an X property with the bus address and tries to connect to it, aborting if successful. This fixes a bug where, if the launcher was run twice (perhaps by both an autostart script and a request for the bus address), the second instance would start its main loop, eventually abort, and delete the X property, which would cause a new X property to be created later, overriding the old one, if a different user requested the address, leading to a11y breakage. --- diff --git a/bus/at-spi-bus-launcher.c b/bus/at-spi-bus-launcher.c index 9300979..dcc35e4 100644 --- a/bus/at-spi-bus-launcher.c +++ b/bus/at-spi-bus-launcher.c @@ -27,6 +27,7 @@ #include #include #include +#include =20 #include #include @@ -349,6 +350,49 @@ is_a11y_using_corba (void) return result; } =20 +static gboolean +already_running () +{ + Atom AT_SPI_BUS; + Atom actual_type; + Display *bridge_display; + int actual_format; + unsigned char *data =3D NULL; + unsigned long nitems; + unsigned long leftover; + gboolean result =3D FALSE; + + bridge_display =3D XOpenDisplay (NULL); + if (!bridge_display) + return FALSE; + =20 + AT_SPI_BUS =3D XInternAtom (bridge_display, "AT_SPI_BUS", False); + XGetWindowProperty (bridge_display, + XDefaultRootWindow (bridge_display), + AT_SPI_BUS, 0L, + (long) BUFSIZ, False, + (Atom) 31, &actual_type, &actual_format, + &nitems, &leftover, &data); + + if (data) + { + GDBusConnection *bus; + GError *error =3D NULL; + const gchar *old_session =3D g_getenv ("DBUS_SESSION_BUS_ADDRESS"); + /* TODO: Is there a better way to connect? This is really hacky */ + g_setenv ("DBUS_SESSION_BUS_ADDRESS", data, TRUE); + bus =3D g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error); + g_setenv ("DBUS_SESSION_BUS_ADDRESS", old_session, TRUE); + if (bus !=3D NULL) + result =3D TRUE; + g_object_unref (bus); + } + + XCloseDisplay (bridge_display); + return result; +} + + int main (int argc, char **argv) @@ -363,6 +407,9 @@ main (int argc, if (is_a11y_using_corba ()) return 0; =20 + if (already_running ()) + return 0; + _global_app =3D g_slice_new0 (A11yBusLauncher); _global_app->loop =3D g_main_loop_new (NULL, FALSE); _global_app->launch_immediately =3D (argc =3D=3D 2 && strcmp (argv[1],= "--launch-immediately") =3D=3D 0); -- cgit v0.9 1.1 app-accessibility/at-spi2-core/files/at-spi2-core-2.= 0.2-disable-teamspaces-test.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-accessibility/= at-spi2-core/files/at-spi2-core-2.0.2-disable-teamspaces-test.patch?rev=3D= 1.1&view=3Dmarkup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-accessibility/= at-spi2-core/files/at-spi2-core-2.0.2-disable-teamspaces-test.patch?rev=3D= 1.1&content-type=3Dtext/plain Index: at-spi2-core-2.0.2-disable-teamspaces-test.patch =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D diff --git a/dbind/dbtest.c b/dbind/dbtest.c index e8bbb63..9843c3d 100644 --- a/dbind/dbtest.c +++ b/dbind/dbtest.c @@ -417,7 +417,7 @@ int main (int argc, char **argv) =20 test_helpers (); test_marshalling (); - test_teamspaces (bus); + /* test_teamspaces (bus); */ =20 return 0; }