Closed Bug 1204171 Opened 4 years ago Closed 3 years ago

Accessible ATK/AT-SPI2 keyboard event notifications do not appear to get deregistered

Categories

(Core :: Disability Access APIs, defect)

Unspecified
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox43 --- affected
firefox52 --- fixed

People

(Reporter: jdiggs, Assigned: tbsaunde, NeedInfo)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Steps to reproduce:
1. Launch Firefox
2. Launch the attached accessible-event listener in a terminal
3. Repeat the following steps several times:
   a. Switch to Firefox
   b. Press Left Arrow once
   c. Press Right Arrow once
   d. Press F4 to terminate the listener
   e. Re-launch the listener and go to step 3a.

Expected results: Each key press would result in only one accessible key-press notification.

Actual results: Each key press results in x key-press notifications, where x is the number of times steps 3a through 3e have been performed. (Sample output below.)

I can reproduce this in Thunderbird and Firefox, but do not see the problem in GNOME Shell (clutter-based) or Gtk+ apps.

=============
Sample output
=============

[jd@blockhead ~]$ ./keyevents.py 
Press F4 to terminate this listener
Left pressed
Right pressed
F4 pressed
[jd@blockhead ~]$ ./keyevents.py 
Press F4 to terminate this listener
Left pressed
Left pressed
Right pressed
Right pressed
F4 pressed
[jd@blockhead ~]$ ./keyevents.py 
Press F4 to terminate this listener
Left pressed
Left pressed
Left pressed
Right pressed
Right pressed
Right pressed
F4 pressed
[jd@blockhead ~]$ ./keyevents.py 
Press F4 to terminate this listener
Left pressed
Left pressed
Left pressed
Left pressed
Right pressed
Right pressed
Right pressed
Right pressed
F4 pressed
WHen I run that event listener restarting it doesn't show me duplicate events.  Maybe orca is eating all but one of the events?
Flags: needinfo?(jdiggs)
The listener id is postincremented as a subexpression of being inserted into
the hash table.  That means the key inserted into the table is 1 less than the
value returned from the function.  Which means that later attempts to remove
the returned id will fail because that hash table knows about a different id.
Attachment #8794808 - Flags: review?(dbolter)
Comment on attachment 8794808 [details] [diff] [review]
make mai_util_add_key_event_listener return the correct listener id

Review of attachment 8794808 [details] [diff] [review]:
-----------------------------------------------------------------

good catch.
Attachment #8794808 - Flags: review?(dbolter) → review+
Pushed by tsaunders@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/14b0ea0c7b1c
make mai_util_add_key_event_listener return the correct listener id r=davidb
https://hg.mozilla.org/mozilla-central/rev/14b0ea0c7b1c
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Assignee: nobody → tbsaunde+mozbugs
You need to log in before you can comment on or make changes to this bug.