Bug 270472 - [JFace] Orca cannot read Eclipse status line
Summary: [JFace] Orca cannot read Eclipse status line
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: 3.6.1   Edit
Assignee: Oleg Besedin CLA
QA Contact: Oleg Besedin CLA
URL:
Whiteboard:
Keywords: accessibility
Depends on:
Blocks: 322396
  Show dependency tree
 
Reported: 2009-03-30 12:00 EDT by Carolyn MacLeod CLA
Modified: 2010-08-17 14:07 EDT (History)
9 users (show)

See Also:
bokowski: review+
ob1.eclipse: review+


Attachments
patch (1.23 KB, patch)
2010-05-21 12:07 EDT, Silenio Quarti CLA
no flags Details | Diff
orca log (306.01 KB, text/x-log)
2010-05-21 14:42 EDT, Silenio Quarti CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Carolyn MacLeod CLA 2009-03-30 12:00:38 EDT
From bug 78244:

> > I am testing eclipse with orca, but with orca I can not read the status line
> 
> Does Orca read the status line in any other GTK application? If so, what Orca
> command do you use to read a status line?
Yes, I can read the status line in applications like gnome-terminal,
thunderbird, firefox, evolution, open office and etc. I mapped
Kps_lock+pageDown (or Insert+PageDown) to read the status line, like in jaws.
Comment 1 jose vilmar estacio de souza CLA 2009-03-31 05:09:51 EDT
Looking in the sources of orca I found in the file src/orca/where_am_I.py a function called _getStatusBar.
The function looks in all components if it can find a component which the type is status_bar. This is in the file src/orca/where_am_i.py around line 1840, orca version 2.26.
            if child.getRole() == pyatspi.ROLE_STATUS_BAR:
	                self._statusBar = child
                return

I suspect that eclipse doesn't implement the status line using a status bar component. So orca can not detect it.
I believe to be  possible modify orca so that it looks for another kind of component instead of a pyatspi.ROLE_STATUS_BAR and I think that I know how to do this. 

What I don't know is what kind of component do I need to look for.

Comment 2 Dani Megert CLA 2009-04-06 05:47:01 EDT
>What I don't know is what kind of component do I need to look for.
Take a look at org.eclipse.jface.action.StatusLine
Comment 3 Carolyn MacLeod CLA 2010-05-17 02:29:23 EDT
SSQ, do you have any other ideas on how to help Orca read the status line?
Description_for relation plus description_changed event(s) would probably work, if Orca implements this feature (Joanie was considering it).
Comment 4 Silenio Quarti CLA 2010-05-21 11:03:54 EDT
(In reply to comment #0)
> From bug 78244:
> > command do you use to read a status line?
> Yes, I can read the status line in applications like gnome-terminal,
> thunderbird, firefox, evolution, open office and etc. I mapped
> Kps_lock+pageDown (or Insert+PageDown) to read the status line, like in jaws.

Jose, could you give me some instructions how to setup the orca key binding to read the status line?
Comment 5 Silenio Quarti CLA 2010-05-21 11:08:09 EDT
(In reply to comment #3)
> SSQ, do you have any other ideas on how to help Orca read the status line?
> Description_for relation plus description_changed event(s) would probably work,
> if Orca implements this feature (Joanie was considering it).

SWT added ACC.ROLE_STATUSBAR in 3.6. We need to check if orca would read the status line if that was used by org.eclipse.jface.action.StatusLine.
Comment 6 jose vilmar estacio de souza CLA 2010-05-21 11:33:23 EDT
(In reply to comment #5)
> Jose, could you give me some instructions how to setup the orca key binding to
> read the status line?

Press Orca_key+space to activate the preferences of orca.
Click in the key binds page.
Expand orca.
Select speak  the status bar.
Press space in the key bind column
Press the desired key and press enter
Click in the save button.
Comment 7 Joanmarie CLA 2010-05-21 11:48:21 EDT
If Eclipse exposes the status bar as ATK_ROLE_STATUSBAR and Orca fails to present the status bar, my guess is that the default speech (and braille?) generators are expecting a particular widget hierarchy which they are not seeing from Eclipse.

If so, this is not necessarily an Eclipse bug. More likely it would simply mean that the Orca speech and braille generators need to be made aware of the specific situation/hierarchy in Eclipse. We see a lot of differences amongst apps and toolkits (hence why Orca has custom scripts). This may just be another one.
Comment 8 Carolyn MacLeod CLA 2010-05-21 12:04:19 EDT
Hi, Joanie, and welcome.

When Silenio said "SWT added ACC.ROLE_STATUSBAR in 3.6", he meant that the capibility now exists for Eclipse code to expose ACC.ROLE_STATUSBAR. It hasn't actually been done yet <g>. SWT is the lowest layer in the Eclipse stack. It is the layer right on top of the operating system.

Silenio looked up a layer, and discovered org.eclipse.jface.action.StatusLine.
So it looks like we would be asking the JFace folks (the layer above SWT, and a whole other team of developers <grin>) to add some code to their layer to expose ROLE_STATUSBAR.

So, from your response, it looks like Orca would indeed read the status line if that was exposed in org.eclipse.jface.action.StatusLine...   :)

I wonder if this is in fact a (better?) fix for the other problem where the status line is above the focus control, and it is being updated based on user input. The user could notice that the Finish button was not enabled, and then read the status line to learn why not.
Comment 9 Silenio Quarti CLA 2010-05-21 12:07:47 EDT
Created attachment 169517 [details]
patch

Currently, eclipse is not exposing the status bar as ATK_ROLE_STATUSBAR.

This patch makes that happen. With the patch, orca reads the status bar, but not all the time. It reads the status bar when eclipse comes up if an editor has focus, but if the editor looses focus and gets it back, orca will not read anymore. If the Package Explorer is in focus, orca always reads the status bar.

I am not sure what causes this behavior.
Comment 10 jose vilmar estacio de souza CLA 2010-05-21 14:15:08 EDT
(In reply to comment #9)
> Created an attachment (id=169517) [details]
> patch
> 
> Currently, eclipse is not exposing the status bar as ATK_ROLE_STATUSBAR.
> 
> This patch makes that happen. With the patch, orca reads the status bar, but
> not all the time. It reads the status bar when eclipse comes up if an editor
> has focus, but if the editor looses focus and gets it back, orca will not read
> anymore. If the Package Explorer is in focus, orca always reads the status bar.
> 
> I am not sure what causes this behavior.

It would be interesting to see the debug output of an orca with this situation. To run orca in debug mode you can execute orca using the following command:
orca --replace --debug-file=debug.out
This will restart orca in debug mode.
Try to access the status barr in different ways, kill orca, attach the debug.out file in this bug or send me via e-mail.
Thanks.
Comment 11 Silenio Quarti CLA 2010-05-21 14:42:49 EDT
Created attachment 169544 [details]
orca log

Here is the debug file for:

1) Start eclipse with patch above
2) Press Orca+PageDown to read status bar (worked and read "Writable Smart Insert line number column number)
3) Give focus to Package Explorer view
4) Press Orca+PageDown to read status bar (worked)
5) Give focus back to the editor
6) Press Orca+PageDown a few times to read status bar (did not work)
7) Give focus to Outline View
8) Press Orca+PageDown to read status bar (worked)
Comment 12 Joanmarie CLA 2010-05-23 12:11:46 EDT
Silenio, it might be sleep deprivation, but nothing is immediately jumping out at me from the debug.out. And I was kinda hoping not to have to build Eclipse. :-) If José wants to do so, then never mind. :-)

Otherwise.... I'm wondering how you'd feel about committing the fix seeing as how it works most of the time. (Definitely an improvement!) Then we could take a closer look at things to see why Orca is not speaking the status bar when the editor loses and regains focus.
Comment 13 Silenio Quarti CLA 2010-05-25 13:45:40 EDT
Oleg, this change is in jface. It might be to late to put this in for 3.6, but we should consider for 3.6.1.

We can work on the remaining problem once this change is in.
Comment 14 Oleg Besedin CLA 2010-05-31 09:03:15 EDT
(In reply to comment #13)
> Oleg, this change is in jface. It might be to late to put this in for 3.6, but
> we should consider for 3.6.1.

Sounds good.
Comment 15 Carolyn MacLeod CLA 2010-07-14 00:06:59 EDT
Oleg, now would be a good time to put this in to 3.6.1 and 3.7.
Comment 16 Boris Bokowski CLA 2010-08-16 05:36:47 EDT
+1.
Comment 17 Oleg Besedin CLA 2010-08-17 14:07:18 EDT
Patch applied to the R3_6_maintenance branch.

As can be seen from Silenio's comment 9, there are still some wrinkles to iron out. As suggested by the bug 322396 comment 5, I'll mark this bug as fixed (the behavior improved and it is not likely that we can do better for 3.6.1) and will re-open bug 322396 for further improvements.