GNOME Bugzilla – Bug 677221
Orca does not present run dialog text
Last modified: 2012-06-22 16:12:33 UTC
Created attachment 215360 [details] event listener Steps to reproduce: 1. Launch the attached listener in a terminal 2. Press Alt + F2 3. Type some text 4. Press Left and Right Arrow Expected results: lineAtOffset and charAtOffset would show the correct text and offsets Actual results: lineAtOffset and charAtOffset are each ('', 0, 0) The former is needed for the braille display; the latter for text presentation when arrowing. I could use pyatspi's getText() to get the character; getting the line is less straightforward. And both would require a gnome-shell (or clutter/cally) specific Orca hack or two. So I would prefer to see this fixed on the gnome-shell side if possible.
Created attachment 215361 [details] event listener Corrected listener. Sorry for the noise.
After take a look, the problem are the missed implementation from some AtkText methods on Clutter, specifically: * atk_text_get_text_after_offset * atk_text_get_text_at_offset * atk_text_get_character_at_offset I had a bug with that issue, but it seems that it was not moved to GNOME bugzilla when clutter bugzilla was moved there.
(In reply to comment #2) > After take a look, the problem are the missed implementation from some AtkText > methods on Clutter, specifically: > > * atk_text_get_text_after_offset > * atk_text_get_text_at_offset > * atk_text_get_character_at_offset This is properly implemented, the one not implemented is this one: * text_get_text_before_offset Sorry for the noise.
Created attachment 215729 [details] [review] Implementation for atk_text_get_text_[before/at/after]_offset When Matthias Clasen and Benjamin Otte made a revamp of the gtk+ ATK implementation, one the the great things that made is reimplement these methods based on pango insted of GtkTextBuffer, so making GailUtil not required (when cally was an isolated library, those methods were implemented using that library). This patch is just a copy and paste of those methods, something that I'm not sure if it is acceptable or not.
Just to give some backgroun and/or some discussion. Ideally code from last patch should be in a common place, like pango (probably it would be possible to add this utility methods and not adding a ATK dependency on pango). In fact we mentioned that when Matthias was working on that. The problem is that at this moment nobody is really happy with some methods of AtkText API, and specifically on those ones. The combination of three methods with almost the same signature (before/at/after) and all those boundaries make this hard to understand, on AT and implementor side. So AFAIR, the reason to not move this to a common library was the hope of getting a more reasonable AtkText API. Something that in the end didn't happen because what we have is used and working, and we had plenty of stuff not working. So, in my opinion, what I would like to happen?: 1. In the short term: apply patch on comment 4 on clutter in order to solve this bug now. 2. In the medium term: move those methods from gtkpango.c to a common library. In this case it could be a specific library (like old GailUtil) or ideally on pango itself. Remove code added on 1. 3. In the long term: while 1. and 2. work on a more reasonable AtkText API, and implement it on that common library. Deprecate methods added on 2.
Review of attachment 215729 [details] [review]: the amount of duplicate code is pretty scary, but if the plan is to have it inside Pango and ATK in the long term, then I can live with it for the time being. ::: clutter/cally/cally-text.c @@ +374,3 @@ +/***** pango stuff ****/ + I'd add a pretty big: FIXME: all this code belongs into Pango notice, just so that we don't accidentally forget about it. ;-)
(In reply to comment #6) > > I'd add a pretty big: > > FIXME: all this code belongs into Pango > > notice, just so that we don't accidentally forget about it. ;-) FIXME added. No one else complained about this, commit pushed, closing the bug.