Re: [orca-list] orca 3.11 and java applications



Hi all.
I am sending in attach a patch to solve the problem related to java swing applications and the menu bar.
It must be applied to latest orca master.
I do not know if this is the best implementation, but it seems to work.

Criticism, suggestions, corrections and etc. are very welcome.
Thanks.



On 11/21/2013 10:59 PM, Joanmarie Diggs wrote:
Hey José.

there is the lack of a left parenthesis in
src/orca/scripts/toolkits/J2SE-access-bridge/script.py, at line 176.

D'oh! Fixed pushed to master.

Now the problem is that the menu bar is not read by orca when I press
the f10 key.

Okay, let's see what we've got to work with. To keep the verbiage down
for ease of reading, I'm going to trim out a lot of the log output.

vvvvv PROCESS OBJECT EVENT focus: vvvvv

We really want to ignore those focus: events if we can since they are
going away.

vvvvv PROCESS OBJECT EVENT object:state-changed:selected vvvvv

That selected event is for the File menu. That's one candidate. But
let's see what else we've got....

vvvvv PROCESS OBJECT EVENT object:property-change:accessible-value vvvvv

That value-change event is for the File menu. Insert a "huh?" here.
Silly toolkit....

vvvvv PROCESS OBJECT EVENT object:state-changed:checked vvvvv

And now the file menu claims to be checked. Super. Moving on....

vvvvv PROCESS OBJECT EVENT object:state-changed:focused vvvvv
OBJECT EVENT: object:state-changed:focused             detail=(1,0,0)
     app.name='GroovyConsole' name='File' role='menu' state='checked
enabled focusable selectable selected sensitive showing visible'
relations=''
Script for event: GroovyConsole
(module=orca.scripts.toolkits.J2SE-access-bridge.script)
script.skipObjectEvent: skipped due to more recent event of the same
type in a different object
^^^^^ PROCESS OBJECT EVENT object:state-changed:focused ^^^^^

The above event looks like the winner. However, you'll notice that even
though it has detail1 == 1 (means it is claiming to have gained focus),
it doesn't have state focused in the state set. That might be a bug.
Then again, it might not, because the output indicates it was skipped
because something else claimed focus after it. So the lack of state
focused in the state set might not be a bug after all. Let's see what
claimed focus....

This next item:

vvvvv PROCESS OBJECT EVENT object:state-changed:focused vvvvv
OBJECT EVENT: object:state-changed:focused             detail=(0,0,0)
     app.name='GroovyConsole' name='None' role='push button'
state='enabled focusable opaque sensitive showing visible' relations=''
Script for event: GroovyConsole
(module=orca.scripts.toolkits.J2SE-access-bridge.script)
TOTAL PROCESSING TIME: 0.0042
^^^^^ PROCESS OBJECT EVENT object:state-changed:focused ^^^^^

Is an indication of a focus loss (detail1 == 0, plus it doesn't have
state focused).

And the winner is:

vvvvv PROCESS OBJECT EVENT object:state-changed:focused vvvvv
OBJECT EVENT: object:state-changed:focused             detail=(1,0,0)
     app.name='GroovyConsole' name='None' role='root pane' state='enabled
focusable focused opaque sensitive showing visible' relations=''

That guy. A root pane is claiming focus. Fail. But we have no indication
that it is not really focused from the above. As a result, we have to
trust the toolkit.

SPEECH OUTPUT: 'root pane'
TOTAL PROCESSING TIME: 0.0324
^^^^^ PROCESS OBJECT EVENT object:state-changed:focused ^^^^^

Thus we present that root pane.

I suspect that merely ignoring the root pane's focus claim in
onFocusedChanged() will be insufficient because of skipObjectEvent()
seeing the subsequent focus claim of the root pane. But you can try.

If that fails as I expect it to, I don't think you'll want to modify or
override skipObjectEvent() because that is one of our defenses for event
floods. It needs to remain very light and performant.

So what else can we do in the face of this bogus focus claim?

If you look in that toolkit script, there are existing hacks in place
related to popup menus and root panes. As sad as I am to make the
following suggestion.... It would be interesting to see if the current
hack for popup menus could be tweaked slightly to also apply to the
menus on the menu bar.

You up for giving that a try?

Thanks.

Thank you!!
--joanie



--
{}S José Vilmar Estácio de Souza

Attachment: 0001-Fix-menu-presentation-in-java-swing-apps.patch
Description: Text Data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]