From a660a293c791062d6c40bd275ebbf6444e713f8b Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Thu, 28 Jun 2018 01:25:39 +0200 Subject: [PATCH] patches/atspi2-shutdown: Automatically shut down brltty on session shut down. --- debian/changelog | 7 +++++++ debian/patches/atspi2-shutdown | 29 +++++++++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 37 insertions(+) create mode 100644 debian/patches/atspi2-shutdown diff --git a/debian/changelog b/debian/changelog index 801ea9b6..46c9b99a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +brltty (5.6-5) UNRELEASED; urgency=medium + + * patches/atspi2-shutdown: Automatically shut down brltty on session shut + down. + + -- Samuel Thibault Thu, 28 Jun 2018 01:24:57 +0200 + brltty (5.6-4) unstable; urgency=medium * Cherry-pick python brlapi close fix, to avoid orca accumulating brlapi diff --git a/debian/patches/atspi2-shutdown b/debian/patches/atspi2-shutdown new file mode 100644 index 00000000..90d825b1 --- /dev/null +++ b/debian/patches/atspi2-shutdown @@ -0,0 +1,29 @@ +https://github.com/brltty/brltty/pull/137 + +commit fba63ebd4efef71b9059ff1afa157dabe5a897d5 +Author: Samuel Thibault +Date: Thu Jun 28 01:20:58 2018 +0200 + + atspi2: shutdown brltty automatically on session shutdown + +diff --git a/Drivers/Screen/AtSpi2/screen.c b/Drivers/Screen/AtSpi2/screen.c +index e9d770057..39dddc015 100644 +--- a/Drivers/Screen/AtSpi2/screen.c ++++ b/Drivers/Screen/AtSpi2/screen.c +@@ -1001,6 +1001,16 @@ static DBusHandlerResult AtSpi2Filter(DBusConnection *connection, DBusMessage *m + if (type == DBUS_MESSAGE_TYPE_SIGNAL) { + if (!strncmp(interface, SPI2_DBUS_INTERFACE_EVENT".", strlen(SPI2_DBUS_INTERFACE_EVENT"."))) { + AtSpi2HandleEvent(interface + strlen(SPI2_DBUS_INTERFACE_EVENT"."), message); ++ } else if (!strcmp(interface, DBUS_INTERFACE_LOCAL) && ++ !strcmp(member, "Disconnected")) { ++ logMessage(LOG_CATEGORY(SCREEN_DRIVER), ++ "DBus disconnected signal, shutting down"); ++#ifdef SIGTERM ++ raise(SIGTERM); ++#endif ++#ifdef SIGINT ++ raise(SIGINT); ++#endif + } else { + logMessage(LOG_CATEGORY(SCREEN_DRIVER), + "unknown signal: Intf:%s Msg:%s", interface, member); diff --git a/debian/patches/series b/debian/patches/series index dbe84280..cef8e0bf 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -6,3 +6,4 @@ disable-synth-callback.patch git-pythonclose git-atspi2-init git-xbrlapi +atspi2-shutdown -- GitLab