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 537063 - State of "show system tray icon" combo box in Pidgin preferences not shown correctly
State of "show system tray icon" combo box in Pidgin preferences not shown co...
Status: RESOLVED FIXED
Product: orca
Classification: Applications
Component: general
2.22.x
Other All
: Normal normal
: 2.24.0
Assigned To: Rich Burridge
Orca Maintainers
Depends on: 541167
Blocks:
 
 
Reported: 2008-06-07 02:32 UTC by Jason White
Modified: 2009-03-10 00:05 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
Orca debug log generated whilst testing this problem. (61.51 KB, text/plain)
2008-06-26 15:34 UTC, Rich Burridge
  Details
Orca 2.23.X debug log - with caching. (49.47 KB, text/plain)
2008-06-26 16:09 UTC, Rich Burridge
  Details
Orca 2.23.X debug log - WITHOUT caching. (45.29 KB, text/plain)
2008-06-26 16:10 UTC, Rich Burridge
  Details
pyatspi proof of concept (571 bytes, patch)
2008-06-26 20:39 UTC, Joanmarie Diggs (IRC: joanie)
none Details | Review
patch (1.45 KB, patch)
2008-07-01 08:51 UTC, Li Yuan
none Details | Review
Orca debug output whilst testing this problem. (124.91 KB, text/plain)
2008-07-01 17:09 UTC, Rich Burridge
  Details

Description Jason White 2008-06-07 02:32:20 UTC
Please describe the problem:
The state of the "show system tray icon" combo box in Pidgin preferences is
shown (in both braille and speech) as "always", even if it has been changed.

Verified with Pidgin 2.4.2.

Steps to reproduce:
1. Under Preferences, select the "show system tray icon" combo box.
2. Attempt to change the value to "never".
3. Verify with braille or speech output that the value displayed by Orca is
unchanged. I am told that the actual setting in the application is updated,
however.

Actual results:


Expected results:


Does this happen every time?
yes

Other information:
Comment 1 Rich Burridge 2008-06-11 00:12:30 UTC
Looks like bug #319745 just bit us.

That System Tray Icon combo box has one child: a menu, which has
three children (three menu items). This is not a "normal" combo box.

_getSpeechForComboBox() in speechgenerator.py calls
_getSpeechForObjectName() which in turn calls getDisplayedText()
in default.py which calls __getDisplayedTextInComboBox() because 
this is a combo box.

That routine checks to see if the child is an object of role text.
It isn't.

It then does:

            try:
                comboSelection = combo.querySelection()
                selectedItem = comboSelection.getSelectedChild(0)
            except:
                selectedItem = None

That causes an exception (which is caught), so selectedItem in None.

That means the following code kicks in:

                # We give preference to the name over the text because
                # the text for combo boxes seems to never change in
                # some cases.  The main one where we see this is in
                # the gaim "Join Chat" window.
                #
                displayedText = combo.name
                print "NAME", displayedText

and that's what is returned.

Unfortunately it's always "Always".

Will, what approach do you think we should take to fix this?

1/ Special code in the pidgin script; i.e. override
   __getDisplayedTextInComboBox()?
   Note that the other three combo boxes on that pidgin Preferences pane
   are of similar design, and at least the Command combo box on the
   Sound pane (I didn't check any further).

2/ Extra code in the __getDisplayedTextInComboBox() to look for a child that
   is a menu and then what? None of the menu items had a "selected state".

3/ Something else...
Comment 2 Willie Walker 2008-06-18 15:36:23 UTC
(In reply to comment #1)
> Will, what approach do you think we should take to fix this?

More investigation please.  Try running accerciser and using the event monitor to watch for events on the combobox and its menu.  Also, try using the Python interpreter pane at the bottom of accerciser to do more analysis of the given acc.  For example, I wonder if we're running into a caching problem with the combobox name.  This can be checked by:

1) Selecting the combobox in accerciser
2) Using accerciser's event monitor to listen for events on the selected accessible (the combobox)
3) Doing an "acc.name" in the Python interpreter
4) Going back to pidgin to select a different item in the combobox
5) Looking for name-changed events on the accessible
6) Retrying "acc.name" in the Python interpreter

I'm only guessing, but from the behavior described, we're probably not going to see name-changed events on the combobox, but the combobox will have a different name in step #6.  This would indicate that we have a stale combobox name in the cache and pyatspi is not getting the events it needs to flush the cache.  Another way to confirm this would be to set orca.settings.cacheValues=False.

If a stale cache is the case, it might be a GAIL bug unless we're dealing with a custom widget in Pidgin.  If it's a custom widget, it might be a Pidgin bug.  Looking at the source code for Pidgin and/or GAIL might be needed to determine this.
Comment 3 Rich Burridge 2008-06-20 16:47:55 UTC
> Another way to confirm this would be to set orca.settings.cacheValues=False.

Indeed. That was the problem. Set cacheValues to False and
Orca reads the correct values.

Thanks.
Comment 4 Rich Burridge 2008-06-25 23:54:28 UTC
Just used accerciser to do the steps in comment #2 after selecting
the combo box and then using the mouse to select a different value.

We get the following events:

object:children-changed:remove(1, 0, None)
	source: [combo box | ]
	application: [application | pidgin]
object:bounds-changed(0, 0, <Accessibility.BoundingBox object at 0x8a81c2c>)
	source: [combo box | ]
	application: [application | pidgin]
object:children-changed:add(1, 0, None)
	source: [combo box | On unread messages]
	application: [application | pidgin]
object:bounds-changed(0, 0, <Accessibility.BoundingBox object at 0x8a813ec>)
	source: [combo box | On unread messages]
	application: [application | pidgin]
object:bounds-changed(0, 0, <Accessibility.BoundingBox object at 0x8a81f2c>)
	source: [combo box | On unread messages]
	application: [application | pidgin]

No name-changed events.

Comment 5 Rich Burridge 2008-06-26 00:14:41 UTC
I started up the gtk-demo Combo Boxes example, and did the
same exercise again. These are the events fired for the 
"Some stock icons" combo-box, changing it from "Warning" 
to "Clear":

object:state-changed:focused(1, 0, None)
        source: [combo box | Warning]
        application: [application | gtk-demo]
object:state-changed:focused(0, 0, None)
        source: [combo box | Warning]
        application: [application | gtk-demo]
object:bounds-changed(0, 0, <Accessibility.BoundingBox object at 0x8bf020c>)
        source: [combo box | Warning]
        application: [application | gtk-demo]
object:selection-changed(0, 0, None)
        source: [combo box | Clear]
        application: [application | gtk-demo]
object:state-changed:focused(1, 0, None)
        source: [combo box | Clear]
        application: [application | gtk-demo]
object:bounds-changed(0, 0, <Accessibility.BoundingBox object at 0x8bf07ac>)
        source: [combo box | Clear]
        application: [application | gtk-demo]
focus:(0, 0, None)
        source: [combo box | Clear]
        application: [application | gtk-demo]
object:state-changed:focused(0, 0, None)
        source: [combo box | Clear]
        application: [application | gtk-demo]

This to me suggests that the pidgin combo boxes aren't standard,
or are constructed in a different way than the Gtk demo ones.

I'll look at the pidgin code tomorrow.


Comment 6 Rich Burridge 2008-06-26 15:34:22 UTC
Created attachment 113471 [details]
Orca debug log generated whilst testing this problem.

I've just installed Orca v2.20.3 (pre pyatspi) and tried the
same test again with pidgin 2.4.1.

Pidgin was already running with the Interface pane of the
Preferences window showing. I tabbed  to the System Tray
Icon combo box and changed the Never value to Always.

Orca correctly brailled and spoke the new value (see lines
1288-1289 and 1300-1301 of the attached Orca debug log).

If it works when I turn cacheValues to False and it works
with the pre-pyatspi version of Orca, this suggests (at least
to me), that it's a pyatspi bug.

I'll keep digging deeper.
Comment 7 Rich Burridge 2008-06-26 15:51:37 UTC
With Orca 2.20.3, when we press Return to select "Always", the
following events are queued:

1/ ---------> QUEUEING EVENT object:state-changed:selected
2/ ---------> QUEUEING EVENT object:selection-changed
3/ ---------> QUEUEING EVENT object:state-changed:showing
4/ ---------> QUEUEING EVENT object:state-changed:visible
5/ ---------> QUEUEING EVENT object:state-changed:showing
6/ ---------> QUEUEING EVENT object:state-changed:visible
7/ ---------> QUEUEING EVENT object:children-changed:add
8/ ---------> QUEUEING EVENT object:state-changed:iconified
9/ ---------> QUEUEING EVENT object:state-changed:active
10/ ---------> QUEUEING EVENT window:activate
11/ ---------> QUEUEING EVENT object:state-changed:focused
12/ ---------> QUEUEING EVENT object:state-changed:active
13/ ---------> QUEUEING EVENT object:state-changed:visible
14/ ---------> QUEUEING EVENT object:state-changed:showing
15/ ---------> QUEUEING EVENT object:state-changed:showing
16/ ---------> QUEUEING EVENT object:children-changed:add
17/ ---------> QUEUEING EVENT window:create
18/ ---------> QUEUEING EVENT object:state-changed:visible
19/ ---------> QUEUEING EVENT object:state-changed:iconified
20/ ---------> QUEUEING EVENT object:state-changed:visible
21/ ---------> QUEUEING EVENT object:state-changed:visible
22/ ---------> QUEUEING EVENT object:state-changed:visible
23/ ---------> QUEUEING EVENT object:state-changed:visible
24/ ---------> QUEUEING EVENT object:state-changed:visible
25/ ---------> QUEUEING EVENT object:state-changed:visible
26/ ---------> QUEUEING EVENT object:state-changed:visible
27/ ---------> QUEUEING EVENT object:children-changed:add
28/ ---------> QUEUEING EVENT focus:

Event #11 ("object:state-changed:focused") is the one that
causes the new value to be brailled and spoken.

With latest Orca 2.23.X, when we press Return to select "Always", 
only the following events are queued:

---------> QUEUEING EVENT object:state-changed:selected
---------> QUEUEING EVENT object:selection-changed
---------> QUEUEING EVENT object:state-changed:showing
---------> QUEUEING EVENT object:state-changed:showing
---------> QUEUEING EVENT object:state-changed:showing
---------> QUEUEING EVENT object:state-changed:active
---------> QUEUEING EVENT window:activate
---------> QUEUEING EVENT object:state-changed:focused
---------> QUEUEING EVENT object:state-changed:active
---------> QUEUEING EVENT window:deactivate
---------> QUEUEING EVENT object:state-changed:focused
---------> QUEUEING EVENT object:state-changed:active
---------> QUEUEING EVENT window:activate
---------> QUEUEING EVENT object:state-changed:active

Everything else is the same:

* pidgin 2.4.1
* same gtk+/gail/atk

Anybody have any ideas why there should be such a difference?

I'll keep trying to dig deeper, but I think I need a clue to 
what might be going on here.

Thanks.
Comment 8 Rich Burridge 2008-06-26 16:09:44 UTC
Created attachment 113474 [details]
Orca 2.23.X debug log - with caching.
Comment 9 Rich Burridge 2008-06-26 16:10:21 UTC
Created attachment 113475 [details]
Orca 2.23.X debug log - WITHOUT caching.
Comment 10 Rich Burridge 2008-06-26 16:25:21 UTC
Here's the events I'm seeing when you press Return in the combo
box to change the value from "Never" to "Always":


Orca 2.23.X (with caching):

---------> QUEUEING EVENT object:state-changed:selected
---------> QUEUEING EVENT object:selection-changed
---------> QUEUEING EVENT object:state-changed:showing
---------> QUEUEING EVENT object:state-changed:showing
---------> QUEUEING EVENT object:state-changed:active
---------> QUEUEING EVENT window:activate
---------> QUEUEING EVENT object:state-changed:focused
---------> QUEUEING EVENT object:state-changed:active
---------> QUEUEING EVENT focus:

----


Orca 2.23.X (WITHOUT caching):

---------> QUEUEING EVENT object:state-changed:selected
---------> QUEUEING EVENT object:selection-changed
---------> QUEUEING EVENT object:state-changed:showing
---------> QUEUEING EVENT object:state-changed:showing
---------> QUEUEING EVENT object:state-changed:showing
---------> QUEUEING EVENT object:state-changed:showing
---------> QUEUEING EVENT object:state-changed:active
---------> QUEUEING EVENT window:activate
---------> QUEUEING EVENT object:state-changed:focused
---------> QUEUEING EVENT object:state-changed:active
---------> QUEUEING EVENT focus:

==========================

In more detail:

Orca 2.23.X (with caching):

Event #1:
OBJECT EVENT: object:state-changed:selected            detail=(0,0)
    app.name='pidgin' name='Always' role='menu item' state='enabled focused selectable sensitive showing visible' relations=''

Event #2:
OBJECT EVENT: object:selection-changed                 detail=(0,0)
    app.name='pidgin' name='None' role='menu' state='enabled sensitive' relations=''

Event #3:
OBJECT EVENT: object:state-changed:showing             detail=(0,0)
    app.name='pidgin' name='None' role='window' state='enabled sensitive' relations=''

Event #4:
OBJECT EVENT: object:state-changed:showing             detail=(0,0)
    app.name='pidgin' name='None' role='menu' state='enabled sensitive' relations=''

Event #5:
OBJECT EVENT: object:state-changed:active              detail=(0,0)
    app.name='pidgin' name='None' role='window' state='enabled sensitive' relations=''

Event #6:
OBJECT EVENT: window:activate                          detail=(0,0)
    app.name='pidgin' name='Preferences' role='dialog' state='active enabled sensitive showing visible' relations=''

Event #7:
OBJECT EVENT: object:state-changed:focused             detail=(1,0)
    app.name='pidgin' name='Never' role='combo box' state='enabled focusable focused sensitive showing visible' relations='labelled by labelled by'

Event #8:
OBJECT EVENT: object:state-changed:active              detail=(1,0)
    app.name='pidgin' name='Preferences' role='dialog' state='active enabled sensitive showing visible' relations=''

Event #9:
OBJECT EVENT: focus:                                   detail=(0,0)
    app.name='pidgin' name='Never' role='combo box' state='enabled focusable focused sensitive showing visible' relations='labelled by labelled by'

----

Orca 2.23.X (WITHOUT caching):

Event #1:
OBJECT EVENT: object:state-changed:selected            detail=(0,0)
    app.name='pidgin' name='Always' role='menu item' state='enabled focused selectable sensitive showing visible' relations=''

Event #2:
OBJECT EVENT: object:selection-changed                 detail=(0,0)
    app.name='pidgin' name='None' role='menu' state='enabled sensitive' relations=''

Event #3:
OBJECT EVENT: object:state-changed:showing             detail=(0,0)
    app.name='pidgin' name='None' role='window' state='enabled sensitive' relations=''

Event #4:
OBJECT EVENT: object:state-changed:showing             detail=(0,0)
    app.name='pidgin' name='None' role='menu' state='enabled sensitive' relations=''

Event #4a:
OBJECT EVENT: object:state-changed:showing             detail=(0,0)
    app.name='pidgin' name='Always' role='label' state='enabled multi line sensitive showing visible' relations=''

Event #4b:
OBJECT EVENT: object:state-changed:showing             detail=(1,0)
    app.name='pidgin' name='Always' role='label' state='enabled multi line sensitive showing visible' relations=''

Event #5:
OBJECT EVENT: object:state-changed:active              detail=(0,0)
    app.name='pidgin' name='None' role='window' state='enabled sensitive' relations=''

Event #6:
OBJECT EVENT: window:activate                          detail=(0,0)
    app.name='pidgin' name='Preferences' role='dialog' state='active enabled sensitive showing visible' relations=''

Event #7:
OBJECT EVENT: object:state-changed:focused             detail=(1,0)
    app.name='pidgin' name='Always' role='combo box' state='enabled focusable focused sensitive showing visible' relations='labelled by labelled by'

Event #8:
OBJECT EVENT: object:state-changed:active              detail=(1,0)
    app.name='pidgin' name='Preferences' role='dialog' state='active enabled sensitive showing visible' relations=''

Event #9:
OBJECT EVENT: focus:                                   detail=(0,0)
    app.name='pidgin' name='Always' role='combo box' state='enabled focusable focused sensitive showing visible' relations='labelled by labelled by'

=================================

The difference would appear to be the inclusion of two new events when
we are running WITHOUT caching:

Event #4a:
OBJECT EVENT: object:state-changed:showing             detail=(0,0)
    app.name='pidgin' name='Always' role='label' state='enabled multi line sensitive showing visible' relations=''

Event #4b:
OBJECT EVENT: object:state-changed:showing             detail=(1,0)
    app.name='pidgin' name='Always' role='label' state='enabled multi line sensitive showing visible' relations=''

and the incorrect name with event #9 (focus:") when we are running with
caching:

Event #9:
OBJECT EVENT: focus:                                   detail=(0,0)
    app.name='pidgin' name='Never' role='combo box' state='enabled focusable focused sensitive showing visible' relations='labelled by labelled by'

Comment 11 Joanmarie Diggs (IRC: joanie) 2008-06-26 20:39:08 UTC
Created attachment 113487 [details] [review]
pyatspi proof of concept
Comment 12 Rich Burridge 2008-06-26 21:12:05 UTC
Li, I think we need your input here. 

Will, Joanie and I have been extensively debugging this, and we 
think that a GtkOptionMenu (which is a child of GtkButton), 
should be sending out an "object:property-change:accessible-name" 
event each time its name changes.

But it's not.

Here's a way to reproduce this.

1/ Start Orca
2/ Start pidgin (we've been testing it with pidgin 2.4.1).
3/ From the Buddy list, bring up Tools->Preferences.
4/ Make sure the Interface pane is showing and tab to the first
   option menu (Show system tray icon:). 
5/ Press space to bring up the menu. 
6/ Press Up/Down to move to a different entry.
7/ Press Return to select it.

Should gail be sending such an event in this case?

Thanks.
Comment 13 Li Yuan 2008-06-30 10:33:11 UTC
Is it accessible-parent or accessible-name? Anyway, it is reasonable to emit the signal when parent/name has changed.

Why does this work for Orca 2.20 but not 2.23?
Comment 14 Willie Walker 2008-06-30 11:52:55 UTC
(In reply to comment #13)
> Is it accessible-parent or accessible-name? Anyway, it is reasonable to emit
> the signal when parent/name has changed.
> 
> Why does this work for Orca 2.20 but not 2.23?

Orca 2.20 uses the old Orca atspi.py module and Orca 2.22+ use the pyatspi support.  I suspect that the old atspi.py module was a bit more aggressive in wiping the cache than pyatspi.

Emitting a name changed event would be really beneficial here, and I think it seems like the correct thing to do.  Thanks Li!
Comment 15 Li Yuan 2008-07-01 08:51:38 UTC
Created attachment 113761 [details] [review]
patch

Patch to emit name change signal. Tested with accerciser and pidgin, works.
Comment 16 Rich Burridge 2008-07-01 17:09:48 UTC
Created attachment 113791 [details]
Orca debug output whilst testing this problem.

Thanks Li! This does seem to be working nicely. 

Tested on latest Ubuntu Intrepid (with libbonobo rev 3460).

See attached debug.out. 

* I changed the System tray icon (see Return key press at line 2653). 

* There is the "object:property-change:accessible-name" event handled 
  at line 2735:

OBJECT EVENT: object:property-change:accessible-name   detail=(0,0)
    app.name='pidgin' name='Always' role='combo box' state='enabled focusable focused selectable sensitive showing visible' relations='labelled by labelled by'

* The "object:state-changed:focused" event at line 2857 results in:

BRAILLE LINE:  'pidgin Application Preferences Dialog TabList Interface Page System Tray Icon System Tray Icon Filler Show system tray icon: Always Combo'
     VISIBLE:  'Always Combo', cursor=1

SPEECH OUTPUT: 'Interface page System Tray Icon'
SPEECH OUTPUT: 'Show system tray icon: Always combo box'

Could you please check your patch into SVN trunk? I presume you
will be creating a new bug for it too.

Thanks again.
Comment 17 Rich Burridge 2008-07-01 17:16:14 UTC
Adding a "[testing required]", just in case others are 
interested in testing this. :-)
Comment 18 Willie Walker 2008-07-01 19:15:59 UTC
(In reply to comment #17)
> Adding a "[testing required]", just in case others are 
> interested in testing this. :-)
> 

Works great for me with pidgin and it also doesn't seem to introduce any regressions in Orca's gtk-demo regression tests.  More evidence that Li has become the AT-SPI master.  :-)
Comment 19 Li Yuan 2008-07-02 04:31:10 UTC
(In reply to comment #16)
 
> Could you please check your patch into SVN trunk? I presume you
> will be creating a new bug for it too.
> 
Sure. Please refer to bug #541167.
Comment 20 Li Yuan 2008-07-02 04:31:46 UTC
(In reply to comment #18)

> Works great for me with pidgin and it also doesn't seem to introduce any
> regressions in Orca's gtk-demo regression tests.  More evidence that Li has
> become the AT-SPI master.  :-)
> 

Thanks Will. :-)
Comment 21 Willie Walker 2008-07-02 14:17:11 UTC
Thanks for the work, Li!  Rich, I think we can close this one, and I'll let you do it and get the credit since you did the leg work.