After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 488694 - [a11y] Several calculator buttons don't speak correctly with Orca.
[a11y] Several calculator buttons don't speak correctly with Orca.
Status: RESOLVED FIXED
Product: gnome-calculator
Classification: Core
Component: general
5.21.x
Other Linux
: Normal normal
: ---
Assigned To: Rich Burridge
Rich Burridge
Depends on: 485919
Blocks:
 
 
Reported: 2007-10-20 18:07 UTC by Rich Burridge
Modified: 2007-10-23 14:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix for the problem. (40.34 KB, patch)
2007-10-22 21:42 UTC, Rich Burridge
committed Details | Review
Remove the accessible descriptions. (20.90 KB, patch)
2007-10-23 14:55 UTC, Rich Burridge
committed Details | Review

Description Rich Burridge 2007-10-20 18:07:20 UTC
This is with the new version of gcalctool in SVN trunk that using
Glade.

Several of the buttons (like, change sign, division, multiplication
and subtraction) do not speak their "name" correctly. This appears
to also be a problem with the calculator in the gnome-2-20 branch.
They need to have good accessible names, not unicode characters.
Comment 1 Rich Burridge 2007-10-20 18:58:04 UTC
In the "old" gtk.c code, there used to be a routine called
set_accessible_name() (called from make_but_panel) that set the
accessible name for each button.

It's unclear what the "new" equivalent of this is. A quick test
of trying to set the accessible names of the multiplication
button to "Multiply" in the Glade file didn't work.
Comment 2 Robert Ancell 2007-10-22 13:00:22 UTC
Rich, I hoped you'd be able to help with this one.

There were two a11y things I wasn't sure about when converting:
- is gtk_widget_set_name() used in a11y?
- I set all the accessibility strings to be the same as it was as far as I can tell (see the <accessibility> tags in the .glade) but I don't know how to test them.
Comment 3 Rich Burridge 2007-10-22 14:16:28 UTC
I can certainly help with this one. We should need any
special code in gtk.c anymore for this; we should be able
to adjust lines in the Glade file (the Name: lines of the
widgets under the wheelchair icon in Glade).

I tried this over the weekend, and it didn't seem to work.
I need to dig deeper.

Testing would be done by running Orca and seeing what it 
speaks/brailles. Again, I can help with that.
Comment 4 Rich Burridge 2007-10-22 19:02:22 UTC
To answer your question in the code:

    gtk_widget_set_name(X->display_item, "displayitem"); // FIXME: Is this necessary?

Yes it is. The Orca script for gcalctool specifically looks for that name
in order to be able to speak the result of a calculation when the user presses
Return.

--

In the gnome-2-20 gcalctool, there used to be a button structure that
looked like:

struct button {
    char *str;               /* Button display string. */
    char *hstr;              /* Button help string. */
    char *astr;              /* AccessibleName string (if tooltip not useful) */
    guint mods[MAXEXTRAS];   /* Keyboard modifiers (Shift, Ctrl, ...). */
    guint value[MAXEXTRAS];  /* Button keyboard equivalents. */
    char func_char;          /* Unique function string character. */
    enum menu_type mtype;    /* Type of popup menu (if any). */
    void (*func)();          /* Function to obey on button press. */
    char *symname;           /* Expression function name */
    enum button_flags flags; /* Misc flags */
};

It now looks like:

struct button {
    char *symname;           /* Expression function name */
    guint mods[MAXEXTRAS];   /* Keyboard modifiers (Shift, Ctrl, ...). */
    guint value[MAXEXTRAS];  /* Button keyboard equivalents. */
    char func_char;          /* Unique function string character. */
    void (*func)();          /* Function to obey on button press. */
    enum button_flags flags; /* Misc flags */
};

In gtk.c for gnome-2-20 gcalctool, setting the accessible name was done with:

static void
set_accessible_name(GtkWidget *widget, struct button button)
{
    AtkObject *access_object = gtk_widget_get_accessible(widget);

    atk_object_set_name(access_object,
                        (button.astr == NULL) ? button.hstr : button.astr);
}

The closest commented out code I can find in the current gcalctool gtk.c is:

        //AtkObject *access_object = gtk_widget_get_accessible(widget);
        //atk_object_set_name(access_object,
        //(button.astr == NULL) ? button.hstr : button.astr);

We will need to go through the gcalctool gnome-2-20 calctool.c buttons
entries, and for each one where the astr value wasn't NULL, we will need
to set that as the accessible name in the Glade file for that button.

The next comment will work out what those names were.

Comment 5 Rich Burridge 2007-10-22 19:04:12 UTC
Well I take it back. It's pretty much every one of them.
I'll work out a Glade patch and attach it. Probably will
take a couple of hours.
Comment 6 Rich Burridge 2007-10-22 21:42:02 UTC
Created attachment 97676 [details] [review]
Fix for the problem.

Seems to work nicely. Patch committed to SVN trunk.
Closing as FIXED.
Comment 7 Robert Ancell 2007-10-23 00:28:11 UTC
I see what I did here... I set the accessible_description not the accessible_name. The accessible_descriptions should match exactly what the atk_object_set_name() call did (even though the ones using the hstr didn't seem appropriate with the shortcut key in them). We should probably remove all the accessible_description fields now.
Comment 8 Rich Burridge 2007-10-23 02:55:48 UTC
> We should probably remove all the
> accessible_description fields now.

Okay. That seems reasonable. I'll look at that tomorrow
(unless you beat me to it ;-) ).
Comment 9 Rich Burridge 2007-10-23 14:55:41 UTC
Created attachment 97734 [details] [review]
Remove the accessible descriptions.

Also adjusted the "shift left" and "shift right" entries (they were
reversed). Patch committed.