diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2023-10-27 11:13:55 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2023-10-27 16:45:17 +0200 |
commit | 2186fd52d1ef909d4398e84408f76c8357718e1e (patch) | |
tree | eebe0092302abd41af81fb087f26a03cc73ef07e /sc | |
parent | 30027d95f96e8732292391721da8d126c8896fec (diff) |
gtk4 a11y: Implement GtkAccessibleRange iface
Implement the `GtkAccessibleRange` range interface [1]
added in gtk 4.10, which is bridged to the AT-SPI Value
interface on Linux inside gtk.
Also set the related properties to their values retrieved
from the `XAccessibleValue` interface. (Those already
existed before gtk 4.10.)
The GType handling for implementing the interface only
if the `XAccessibleContext` of the underlying LO a11y
object implements `XAccessibleValue` is mostly copied
over from the gtk3 a11y implementation
(in vcl/unx/gtk3/a11y/atkwrapper.cxx) and adapted
a bit.
Let `lo_accessible_range_set_current_value` always return
true independent of whether the given value was actually
set, since LibreOffice (together with Accerciser) otherwise
crashes due to no proper DBus reply being sent, when
trying to set a new value via AT-SPI API, s.a. [2] and [3].
When setting a new value, take the type of the current
value into account, as done for gtk3 in
commit a0b7b47e3ec843d8012a7526c1e8e72d67cc41b1
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Tue Oct 24 12:29:54 2023 +0200
gtk3 a11y: Take current type into account when setting new value
With this change in place, the AT-SPI Value interface
is now shown as available for a checkbox form control
in a Writer doc when selecting the corresponding a11y
object in Accerciser's tree view of the LO a11y hierarchy.
When changing the value via Accerciser, the checkbox in
LibreOffice gets (un)checked as expected. (Setting the
value to 1.0 causes the checkbox to be checked, 0.0 to
become unchecked.).
The initial values (current value, min and max value)
are set properly. However, when querying the current
value after changing it, the initial value is still
returned. This likely needs to be addressed by
bridging the corresponding `AccessibleEventId::VALUE_CHANGED`
event to Gtk/AT-SPI by calling
`gtk_accessible_update_property` with the new value.
However, there's currently no implementation for
handling a11y events in the gtk4 VCL plugin yet, so
leave that for later.
More interfaces to expose more functionality
to the a11y layer will likely be implemented in
upcoming gtk versions (like an interface for Text [4])
and bridging those should presumably be possible in a
similar way.
[1] https://docs.gtk.org/gtk4/iface.AccessibleRange.html
[2] https://gitlab.gnome.org/GNOME/gtk/-/issues/6150
[3] https://gitlab.gnome.org/GNOME/gtk/-/commit/0dbd2bd09eff8c9233e45338a05daf2a835529ab
[4] https://gitlab.gnome.org/GNOME/gtk/-/issues/5912
Change-Id: I84136fd80361d21cf4f79ab17118bb14079ab785
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158556
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'sc')
0 files changed, 0 insertions, 0 deletions