Re: Adventures in calling Atspi from JavaScript

Joseph Scheuhammer <[email protected]>
Newsgroups gmane.comp.gnome.accessibility.general
Message-ID <[email protected]>
Mike wrote:
> Hi Joseph,
>
>> 1. Registering 'object:text-caret-moved' always results in an error.
>>
>> The actual error is garbled, containing non-printable characters. 
>> Here is what I get:
>>
>> > Window manager warning: Log level 16: Atspi: Adding match: 
>> Interface name
>> > 'org.a11y.atspi.Event.object' is invalid.
>
> This is strange; I'm not seeing anything obvious when looking at the 
> code, and I can't reproduce it. Does valgrind show any invalid reads 
> or writes? 

I discovered that the event string I was passing contained an invisible 
character.  Deleting that invisible character fixed registering the 
'object:text-caret-moved' event.  It now works as expected.

> Atspi_event_listener_register_from_callback and 
> deregister_from_callback are convenience functions intended to avoid 
> needing to create an AtspiEventListener. The scope annotations on 
> those functions are incorrect. Changing the scope to "notify" and 
> adding a GDestroyNotify callback might work, although that would mean 
> an API break. Anyway, gjs is creating a wrapper around the callback 
> when it is called, so libatspi sees a different pointer for the 
> deregister call than it saw for the register call, so it does not make 
> a match.
> Doing something like the following works for me, though:
> function cb(e)
> {
>   print(e)
> }
>
> l = Atspi.EventListener.new(cb)
> registered = l.register('object:text-caret-moved')
> l.deregister('object:text-caret-moved') 

Previously I replied that doing the above fixes the register/deregister 
issues I was having.  Thank you very much for the pointers, Mike!

There still remains the issue of of the freezing when focussing on GNOME 
Shell widgets, and a new issue in terms of too many caret tracking 
events.  I document these a bit more on the focus tracker bugzilla.  
More importantly, there is now a patch attached to that bugzilla which 
shows the focus tracking code, warts and all:
https://bugzilla.gnome.org/show_bug.cgi?id=647074#c5

P.S. Aleiva, I couldn't add '[email protected]' to the CC list of the 
bugzilla.  It did accept '[email protected]'.  I hope that's right.

-- 
;;;;joseph.


'A: After all, it isn't rocket science.'
'K: Right. It's merely computer science.'
              - J. D. Klaun -

_______________________________________________
gnome-accessibility-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/gnome-accessibility-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.