GNOME Bugzilla – Bug 675183
Duplicate accessible key events
Last modified: 2012-06-19 13:12:29 UTC
Created attachment 213134 [details] event listener Steps to reproduce: 0. Launch the attached listener For comparison: 1. Move focus to gedit and type 'hello' 2. Press Alt+f to get into the File menu 3. Press Escape to get out of the File menu The bug itself: 4. Press Alt+F1 to get into the overview 5. Type 'hello' 6. Press Escape to cancel the search 7. Press Escape to get out of the overview Results: In gnome-shell, we get double the accessible key events. $ ./keypresses.py >>> KEY PRESSED : h <<< KEY RELEASED: h >>> KEY PRESSED : e <<< KEY RELEASED: e >>> KEY PRESSED : l <<< KEY RELEASED: l >>> KEY PRESSED : l <<< KEY RELEASED: l >>> KEY PRESSED : o <<< KEY RELEASED: o >>> KEY PRESSED : Alt_L >>> KEY PRESSED : f <<< KEY RELEASED: f <<< KEY RELEASED: Alt_L >>> KEY PRESSED : Escape <<< KEY RELEASED: Escape >>> KEY PRESSED : Alt_L <<< KEY RELEASED: F1 <<< KEY RELEASED: F1 <<< KEY RELEASED: Alt_L <<< KEY RELEASED: Alt_L >>> KEY PRESSED : h >>> KEY PRESSED : h <<< KEY RELEASED: h <<< KEY RELEASED: h >>> KEY PRESSED : e >>> KEY PRESSED : e <<< KEY RELEASED: e <<< KEY RELEASED: e >>> KEY PRESSED : l >>> KEY PRESSED : l <<< KEY RELEASED: l <<< KEY RELEASED: l >>> KEY PRESSED : l >>> KEY PRESSED : l <<< KEY RELEASED: l <<< KEY RELEASED: l >>> KEY PRESSED : o >>> KEY PRESSED : o <<< KEY RELEASED: o <<< KEY RELEASED: o >>> KEY PRESSED : Escape >>> KEY PRESSED : Escape <<< KEY RELEASED: Escape <<< KEY RELEASED: Escape >>> KEY PRESSED : Escape >>> KEY PRESSED : Escape <<< KEY RELEASED: Escape <<< KEY RELEASED: Escape
I just discovered that this bug goes away when you restart gnome-shell within the current session.
(In reply to comment #1) > I just discovered that this bug goes away when you restart gnome-shell within > the current session. I confirmed this bug with the GNOME Shell installed on my system. As I didn't upgrade yet, this is GNOME Shell 3.2.X so old. And I confirm that as soon as you restart GNOME Shell, the bug disappear. That makes harder to debug it, as it seems that the bug appear if you make login with GNOME Shell. I will make some extra tests, but I guess that in the end I will require to install on my system a compiled GNOME Shell, using a Virtual Machine or something
After a little of gdb I found that the difference between case one and the other is the number of ATK key event listeners registered (on cally-util.c). When two are emitted there are two key event listener registered, in the other case just one. So it seems that when login, there are an extra call to atk_add_key_event_listener. The good new is that this doesn't happens with atk_add_global_event_listener, as in both cases we got 32 listeners (one per each ATK signal to listen). If this is a real big problem, there is a quick solution. As the atk-bridge only requires one key listener, we could just add a just-one-listener limit on CallyUtil implementation. Anyway it would be good to check first why this is happening, and where it is happening, as I'm not sure if this is an issue on the atk-bridge. But probably this is affected by how the bridge is loaded (see appendix here [1]). PS: as the ideal solution would be totally get rid of global key event registering, probably it would not be a good idea to waste too much time here. Anyway, a little research should be done. [1] https://mail.gnome.org/archives/gnome-accessibility-devel/2012-April/msg00008.html
(In reply to comment #3) > If this is a real big problem, It's not, as far as I have seen so far. Orca simply filters out the duplicates. (Related aside: Not just for Clutter/Cally. We've been doing it for a while now. If memory serves me, Gecko is the biggest spewer of multiple key events when only one is called for.)
Created attachment 213739 [details] [review] Fixes the bug Funnily enough I also solved this problem some years ago on gail: https://bugzilla.gnome.org/show_bug.cgi?id=599907#c3 It seems that I forgot to update cally.
When I try that patch, after having first logged in I get 0 events (whereas before I got 2 of everything). Things go back to normal after gnome-shell gets restarted within the session. Sorry and thanks!
Created attachment 216653 [details] [review] Remove key event listener hash table if no longer required Problem noticed by joanmarie on comment 6 was caused because when the listener hash table got empty, the snooper is uninstalled. But the snooper is only installed on add_key_event if that hash_table is NULL. Two options: a) Install the snooper if the hash table is NULL or empty b) Destroy hash_table and set to NULL when became empty This patch implements b)
*** Bug 678187 has been marked as a duplicate of this bug. ***
it seems the patch in attachment 216653 [details] [review] broke something - see bug 678404