Package: release.debian.org
Severity: normal
Tags: buster
User: release.debian....@packages.debian.org
Usertags: pu

(this is the same content as for the buster update request for the same
package)

[ Reason ]
As reported on
https://lists.debian.org/debian-accessibility/2021/06/msg00003.html
when from an Xorg sesssion one runs

systemctl lightdm restart

which thus restarts the X server, or when for some reason the X session
crashes and the user is back at the lightdm login screen, after logging
back in the java applications are not accessible with the Orca screen
reader.

This is because the user's dbus session bus survives the restart/crash,
which is on purpose as discussed in 
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=992990
and thus the accessibility at-spi stack survives the restart/crash,
which is fine for orca etc. but since a new X server is used, the
address of the at-spi stack is not stored any more as the AT_SPI_BUS
X root property. Non-java applications are fine with that since
nowadays they use the dbus session bus to find the at-spi stack bus.
java-atk-wrapper however was still not using that, and was still using
the AT_SPI_BUS X root property which is considered deprecated.

The proposed changes make java-atk-wrapper use the dbus session bus,
like other accessible applications. It is then not a problem any more
that the restarted user session has a new X server without the
AT_SPI_BUS X root property.

[ Impact ]
Whenever an X session crashes or lightdm is restarted, java applications
in the new user sessions are not accessible to blind people through the
Orca screen reader.

[ Tests ]
I tested it with some VMs on my laptop, and tested by the original
user reporter.

[ Risks ]
The code is quite simple, is committed upstream, and just follows the
current practice of all other accessible applicatoins.

[ Checklist ]
  [X] *all* changes are documented in the d/changelog
  [X] I reviewed all changes and I approve them
  [X] attach debdiff against the package in (old)stable
  [X] the issue is verified as fixed in unstable

[ Changes ]
The code change the startup of java applications: if the AT_SPI_BUS X
root property is not found, they use dbus-send to achieve the standard
at-spi stack bus discovery.

[ Other info ]
This is the same request as for buster.
diff -Nru java-atk-wrapper-0.38.0/debian/changelog 
java-atk-wrapper-0.38.0/debian/changelog
--- java-atk-wrapper-0.38.0/debian/changelog    2021-01-01 15:05:05.000000000 
+0100
+++ java-atk-wrapper-0.38.0/debian/changelog    2021-08-26 02:50:17.000000000 
+0200
@@ -1,3 +1,9 @@
+java-atk-wrapper (0.38.0-2+deb11u1) bullseye; urgency=medium
+
+  * patches/dbus: Also detect at-spi through dbus.
+
+ -- Samuel Thibault <sthiba...@debian.org>  Thu, 26 Aug 2021 02:50:17 +0200
+
 java-atk-wrapper (0.38.0-2) unstable; urgency=medium
 
   [ Samuel Thibault ]
diff -Nru java-atk-wrapper-0.38.0/debian/patches/dbus 
java-atk-wrapper-0.38.0/debian/patches/dbus
--- java-atk-wrapper-0.38.0/debian/patches/dbus 1970-01-01 01:00:00.000000000 
+0100
+++ java-atk-wrapper-0.38.0/debian/patches/dbus 2021-08-26 02:50:17.000000000 
+0200
@@ -0,0 +1,50 @@
+commit 43576f265a16de8f1cd16c8a09d0e6a6006cbe3c
+Author: Samuel Thibault <samuel.thiba...@ens-lyon.org>
+Date:   Thu Aug 26 02:49:06 2021 +0200
+
+    Also use dbus to detect accessibility being enabled
+    
+    This is required if for some reason the AT_SPI_BUS property is not set.
+    That happens for instance if for some reason the dbus session bus (and thus
+    the at-spi bus) is reused between X sessions.
+
+diff --git a/wrapper/org/GNOME/Accessibility/AtkWrapper.java.in 
b/wrapper/org/GNOME/Accessibility/AtkWrapper.java.in
+index cb267fd..d91b985 100644
+--- a/wrapper/org/GNOME/Accessibility/AtkWrapper.java.in
++++ b/wrapper/org/GNOME/Accessibility/AtkWrapper.java.in
+@@ -32,6 +32,11 @@ import java.lang.management.*;
+ 
+ public class AtkWrapper {
+   static boolean accessibilityEnabled = false;
++  static void initAtk() {
++    System.loadLibrary("atk-wrapper");
++    if (AtkWrapper.initNativeLibrary())
++      accessibilityEnabled = true;
++  }
+   static {
+     try {
+       Process p = Runtime.getRuntime().exec("@XPROP@ -root");
+@@ -39,13 +44,20 @@ public class AtkWrapper {
+       String result;
+       while ((result = b.readLine()) != null) {
+         if (result.indexOf("AT_SPI_IOR") >= 0 || result.indexOf("AT_SPI_BUS") 
>= 0) {
+-          System.loadLibrary("atk-wrapper");
+-          if (AtkWrapper.initNativeLibrary())
+-            accessibilityEnabled = true;
++          initAtk();
+           break;
+         }
+       }
+ 
++      if (!accessibilityEnabled) {
++        p = Runtime.getRuntime().exec("dbus-send --session 
--dest=org.a11y.Bus --print-reply /org/a11y/bus org.a11y.Bus.GetAddress");
++        b = new BufferedReader(new InputStreamReader (p.getInputStream ()));
++        while ((b.readLine()) != null);
++        p.waitFor();
++        if (p.exitValue() == 0)
++          initAtk();
++      }
++
+       java.util.List<GarbageCollectorMXBean> gcbeans = 
ManagementFactory.getGarbageCollectorMXBeans();
+       for (GarbageCollectorMXBean gcbean : gcbeans) {
+       NotificationEmitter emitter = (NotificationEmitter) gcbean;
diff -Nru java-atk-wrapper-0.38.0/debian/patches/series 
java-atk-wrapper-0.38.0/debian/patches/series
--- java-atk-wrapper-0.38.0/debian/patches/series       2020-08-02 
02:27:36.000000000 +0200
+++ java-atk-wrapper-0.38.0/debian/patches/series       2021-08-26 
02:50:17.000000000 +0200
@@ -1,3 +1,4 @@
 java-1.7
 
 atk-dep
+dbus

Reply via email to