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 486895 - Arrowing down from column header to table presents wrong column header
Arrowing down from column header to table presents wrong column header
Status: RESOLVED FIXED
Product: orca
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: 2.22.0
Assigned To: Rich Burridge
Orca Maintainers
Depends on: 497218
Blocks:
 
 
Reported: 2007-10-15 17:47 UTC by Willie Walker
Modified: 2008-07-22 19:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Results of trying "speech.stop". (34.28 KB, text/plain)
2008-01-08 17:05 UTC, Rich Burridge
  Details
Patch to hopefully fix the problem. (2.45 KB, patch)
2008-01-08 17:30 UTC, Rich Burridge
reviewed Details | Review
Orca debug output from running with patch (attachment 102402). (58.74 KB, text/plain)
2008-01-08 17:31 UTC, Rich Burridge
  Details
Revision #2 (5.51 KB, patch)
2008-01-10 21:30 UTC, Rich Burridge
committed Details | Review

Description Willie Walker 2007-10-15 17:47:09 UTC
Steps to reproduce:

1. Run gtk-demo Tree View -> List Store demo.  The demo comes up with the "Bug Number" column header with focus.

2. Arrow right twice to the "Description" column header.

3. Arrow down once.  Orca presents the following:

     "BRAILLE LINE:  'gtk-demo Application GtkListStore demo Frame ScrollPane Table Fixed? ColumnHeader < > Fixed? 60482 Normal scrollable notebooks and hidden tabs'",
     "     VISIBLE:  'scrollable notebooks and hidden tabs', cursor=1",
     "SPEECH OUTPUT: ''",
     "SPEECH OUTPUT: 'table'",
     "SPEECH OUTPUT: ''",
     "SPEECH OUTPUT: 'Fixed? column header'",
     "SPEECH OUTPUT: ''",
     "SPEECH OUTPUT: 'Fixed? check box not checked  60482 Normal scrollable notebooks and hidden tabs'"]))

4. Arrow down again.  Orca now presents "Description column header", as though the column header changed from Fixed? to Description.


Expected results:

For step 3, the column header should remain as Description in braille and not presented in speech.  I'd expect something like this:

     "BRAILLE LINE:  'gtk-demo Application GtkListStore demo Frame ScrollPane Table Description ColumnHeader < > Fixed? 60482 Normal scrollable notebooks and hidden tabs'",
     "     VISIBLE:  'scrollable notebooks and hidden tabs', cursor=1",
     "SPEECH OUTPUT: ''",
     "SPEECH OUTPUT: 'table'",
     "SPEECH OUTPUT: ''",
     "SPEECH OUTPUT: 'Fixed? check box not checked  60482 Normal scrollable notebooks and hidden tabs'"]))

For step 4, the Description column header should not be presented in speech.
Comment 1 Willie Walker 2007-10-26 21:52:10 UTC
See also the test/keystrokes/gtk-demo/role_column_header.py test.
Comment 2 Rich Burridge 2007-11-15 22:08:03 UTC
I investigated this. The onFocus() method in default.py is
getting called. In there, is:

...
        if role in (pyatspi.ROLE_LAYERED_PANE,
                    pyatspi.ROLE_TABLE,
                    pyatspi.ROLE_TREE_TABLE,
                    pyatspi.ROLE_TREE):
            if event.source.childCount:
                # Well...we'll first see if there is a selection.  If there
                # is, we'll use it.
                #
                try:
                    selection = event.source.querySelection()
                except NotImplementedError:
                    selection = None
                if selection and selection.nSelectedChildren > 0:
                    newFocus = selection.getSelectedChild(0)
...

In this case, when we Down from the Description column header into 
the table we get an "object:state-changed:focused" event: 
 
OBJECT EVENT: object:state-changed:focused             detail=(1,0)
    app.name='gtk-demo' name='None' role='table' state='enabled focusable focused sensitive showing visible manages descendants' relations=''

The child count is 60, there is a selection and selection.nSelectedChildren
is 4 (the four cells in the first row of the table).

As it currently stands, the code just sets the new focus to child 0, 
even though the "dotted rectangle" is around the child with an index of 3.

If we had previously had an "object:active-descendant-changed" event
as the first row of the table was selected, then 
onActiveDescendantChanged() would have called:

        self.pointOfReference['activeDescendantInfo'] = \
                [orca_state.locusOfFocus.parent,
                 orca_state.locusOfFocus.getIndexInParent()]

and we could have looked for this information in onFocus(), to see if 
that was set and if it was, we could have used that index instead.

But we didn't get such an event, which I think is a bug (which I'll
file next).

Note that when we fix up bug #486908 (Selection and navigation in  
multiselectable items are not properly handled), that this code in 
this area will all probably have to be totally over-hauled.
Comment 3 Rich Burridge 2007-11-15 22:19:48 UTC
I've filed atk/gail bug #497218 on this problem. I think we are blocked
on this, and am adjusting the summary as such. If I'm incorrect, just
let me know.
Comment 4 Willie Walker 2007-11-16 14:30:42 UTC
(In reply to comment #3)
> I've filed atk/gail bug #497218 on this problem. I think we are blocked
> on this, and am adjusting the summary as such. If I'm incorrect, just
> let me know.
> 

I think you are correct.  :-)  Thanks!
Comment 5 Rich Burridge 2008-01-08 15:55:05 UTC
See comment 15 for bug 497218 from Will:
http://bugzilla.gnome.org/show_bug.cgi?id=497218#c15
as something to try to potentially fix the bogus speaking of:
SPEECH OUTPUT: 'Fixed? column header'
now that the patch to bug #497218 seems to be doing the right thing.

I'll try that later today.
Comment 6 Rich Burridge 2008-01-08 17:05:02 UTC
Created attachment 102401 [details]
Results of trying "speech.stop".

Commentary to follow as the text area on the Bugzilla web page
is really too small to see what I'm doing.
Comment 7 Rich Burridge 2008-01-08 17:05:51 UTC
The following is on Ubuntu Gutsy with the gail patch:
http://bugzilla.gnome.org/attachment.cgi?id=102363
to bug #497218 applied.

I added a "speech.stop()" call in onActiveDescendantChanged() in
default.py if the event.source object had a child and was about
to call orca.setLocusOfFocus(event, child):

$ svn diff
Index: src/orca/default.py
===================================================================
--- src/orca/default.py (revision 3434)
+++ src/orca/default.py (working copy)
@@ -3069,6 +3069,7 @@
         - event: the Event
         """
 
+        print "default: onActiveDescendantChanged called."
         if not event.source.getState().contains(pyatspi.STATE_FOCUSED):
             return
 
@@ -3078,6 +3079,8 @@
         #
         child = event.any_data
         if child:
+            print "STOPPING speech."
+            speech.stop()
             orca.setLocusOfFocus(event, child)
         else:
             orca.setLocusOfFocus(event, event.source)

I then reran the test (see attached debug.out). This certainly
removes the first bogus:
SPEECH OUTPUT: 'Fixed? column header'
but there is still a second one that screws things up.

In more detail:

I right arrowed twice to get to the "Description" column
header then pressed Down to enter the list (line 470).

We get the following events:

1/ ---------> QUEUEING EVENT object:state-changed:focused
2/ ---------> QUEUEING EVENT object:state-changed:focused
3/ ---------> QUEUEING EVENT object:selection-changed
4/ ---------> QUEUEING EVENT object:active-descendant-changed
5/ ---------> QUEUEING EVENT focus:

Event 2/ (start processing at line 505) causes:

SPEECH OUTPUT: ''
SPEECH OUTPUT: 'Fixed? column header'
SPEECH OUTPUT: 'check box not checked '

to be queued up for speaking.

Event 4/ (start processing at line 593) causes speech to be stopped and:

SPEECH OUTPUT: ''
SPEECH OUTPUT: 'Description column header'
SPEECH OUTPUT: 'scrollable notebooks and hidden tabs'

to be queued for speaking.

Event 5/ (start processing at line 657) causes the bogus:

SPEECH OUTPUT: ''
SPEECH OUTPUT: 'Fixed? column header'
SPEECH OUTPUT: 'check box not checked '

to be further added to the speech queue.

As well as needing the speech.stop(), I think we need to fix this 
bogus code in onFocus() in default.py:


        # [[[TODO: WDW - HACK to deal with the fact that active cells
        # may or may not get focus.  Their parents, however, do tend to
        # get focus, but when the parent gets focus, it really means
        # that the selected child in it has focus.  Of course, this all
        # breaks when more than one child is selected.  Then, we really
        # need to depend upon the model where focus really works.]]]
        #
        newFocus = event.source

        if role in (pyatspi.ROLE_LAYERED_PANE,
                    pyatspi.ROLE_TABLE,
                    pyatspi.ROLE_TREE_TABLE,
                    pyatspi.ROLE_TREE):
            if event.source.childCount:
                # Well...we'll first see if there is a selection.  If there
                # is, we'll use it.
                #
                try:
                    selection = event.source.querySelection()
                except NotImplementedError:
                    selection = None
                if selection and selection.nSelectedChildren > 0:
                    newFocus = selection.getSelectedChild(0)

                # Otherwise, we might have tucked away some information
                # for this thing in the onActiveDescendantChanged method.
                #
                elif self.pointOfReference.has_key("activeDescendantInfo"):
                    [parent, index] = \
                        self.pointOfReference['activeDescendantInfo']
                    newFocus = parent[index]

Maybe it's a simple case of moving the "Otherwise" clause before the:

                if selection and selection.nSelectedChildren > 0:
                    newFocus = selection.getSelectedChild(0) 

part.

I'll try that next.
Comment 8 Rich Burridge 2008-01-08 17:30:57 UTC
Created attachment 102402 [details] [review]
Patch to hopefully fix the problem.

Commentary to follow.
Comment 9 Rich Burridge 2008-01-08 17:31:59 UTC
Created attachment 102403 [details]
Orca debug output from running with patch (attachment 102402 [details] [review]).

Commentary to follow.
Comment 10 Rich Burridge 2008-01-08 17:33:09 UTC
The following is on Ubuntu Gutsy with the gail patch:
http://bugzilla.gnome.org/attachment.cgi?id=102363
to bug #497218 applied.

As well as adding a "speech.stop()" call in onActiveDescendantChanged() in
default.py if the event.source object had a child and was about
to call orca.setLocusOfFocus(event, child), I also  switched the order
of the two tests in the onFocus() method in default.py.

This has nicely fixed the reported problem (see steps to reproduce
in the description), but it's still doing the wrong thing for the
following:

Steps to reproduce:

1/ Start Orca.

2/ Start gtk-demo Tree View -> List Store demo.  
   The demo comes up with the "Bug Number" column header with focus.

3/ Arrow right twice to the "Description" column header.

4/ Arrow down twice.

5/ Arrow left once.
   Focus is on the "Critical" text.

6/ Press Shift-Tab. Focus is given to the "Severity" column header.

7/ Arrow down once.

Focus is back on the "Critical" text but Orca speaks:

SPEECH OUTPUT: ''
SPEECH OUTPUT: 'Fixed? column header'
SPEECH OUTPUT: 'check box not checked '

But it's the same problem. No "object:selection-changed" event,
so we are unable to setup the index of the child that can be used in
onFocus().

Here's the last part in slightly more detail:

We arrowed Down at line 995.

We only got the following events:

1/ ---------> QUEUEING EVENT object:state-changed:focused
2/ ---------> QUEUEING EVENT object:state-changed:focused
3/ ---------> QUEUEING EVENT focus:

This suggests that this potential fix might be a good one.

I'll add a comment to bug #497218 with this new test case,
so that Li can determine why it's not generating an
"object:selection-changed" event.
Comment 11 Rich Burridge 2008-01-09 16:59:33 UTC
Li open a new bug (bug #508255) on this new problem.

I can confirm that with the gail patch from that bug:
http://bugzilla.gnome.org/attachment.cgi?id=102458

and the gail patch from bug #497218:
http://bugzilla.gnome.org/attachment.cgi?id=102363

and the patch to Orca from this bug:
http://bugzilla.gnome.org/attachment.cgi?id=102402

that Orca is now speaking the correct information.

This is rather a significant change to onActiveDescendantChanged
so I think it needs more testing. Will, could you also review please?

Thanks.
Comment 12 Willie Walker 2008-01-09 17:36:47 UTC
Thanks! I think this looks good and I say commit it as soon as Mike gives it a go.  Make sure to remove the 'print' debug lines in there.  ;-)
Comment 13 Rich Burridge 2008-01-10 15:45:55 UTC
Mike, Li has made this easier for you to test. Both the patches to
gail have been checked into SVN HEAD. So all you should need to do
to test this is configure/build/install gail from SVN HEAD, then apply
the patch to Orca from this bug:
http://bugzilla.gnome.org/attachment.cgi?id=102402

Thanks.
Comment 14 Mike Pedersen 2008-01-10 20:02:44 UTC
After testing this patch with the latest gail I think things are looking good so far.  After Rich checks in the patch I'll get started reviewing the test cases. 
Comment 15 Rich Burridge 2008-01-10 21:30:37 UTC
Created attachment 102545 [details] [review]
Revision #2

Adjusted patch to remove debug messages and fixup the
gtk-demo/role_column_header.py regression test.
Comment 16 Rich Burridge 2008-01-10 21:31:22 UTC
Patch committed. Moving bug to "[pending']" state.
Comment 17 Rich Burridge 2008-01-16 23:15:42 UTC
Well we've shipped Orca 2.21.5, so closing this one as FIXED.
If anybody finds a problem with it, please comment and reopen.