Re: Adventures in calling Atspi from JavaScript



Hi Joseph and Alejandro,


2012/7/18 Piñeiro <apinheiro igalia com>
On 07/17/2012 11:00 PM, Joseph Scheuhammer wrote:
> All,
>
> I've been implementing a _javascript_ object for use within GNOME Shell
> that tracks the keyboard focus and the caret. I am using
> GObjectIntrospection to communicate between _javascript_ and AT-SPI.
> Some things are working, but others aren't. Descriptions of the
> problems are given below. If you see anything that sheds light on
> things, let me know.
>
> 1. Registering 'object:text-caret-moved' always results in an error.

Hmm, this is odd (1)

I'm currently using object:state-changed and object:text-changed and checking the accesible objects the returning at-spi structure returns. Also I'm dropping some information because the current status of unity accessibility implementation.

I didn't found an uniform way to handle with this, I think will be a good topic in next a11y camp at GUADEC to implement mechanism into AT-SPI to track this kind of events.

There's a listener for object:text-caret-moved in ATK, so it shoud work.
 

>
> 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.
>
> How it's registered. Note that 'this._atspiEventListener' is an
> Atspi.EventListener, or, in C, an AtspiEventListener:
>
> registered = this._atspiEventListener.register_from_callback(
> _atspiCaretCB, 'object:text-caret-moved'
> );
>
> - the returned value, 'registered', is 'true'.
> - the callback, '_atspiCaretCB', is never called.
> - I do the same thing for 'object:state-changed:focused' and
> 'object:state-changed:selected', and that works fine.
>
> 2. Focus tracking doesn't work with St widgets.
>
> Registering for 'object:state-changed:focused' and
> 'object:state-changed:selected' works great with GTK widgets, and even
> within web pages with ARIA widgets. But, whenever a GNOME Shell widget
> is invoked, the system freezes for about 5 - 10 seconds. When the UI
> is responsive again, the event passed back, has no accessible
> component within it.

This is odd (2).

Because AFAIK, python based tools, like accerciser can do (1) and (2)
without problems. Joanmarie, Javier H. could you confirm that?

I need to queue the events to handle it later to don't interrupt the system. I didn't notice that with accerciser.
 

>
> > Window manager warning: Log level 16: AT-SPI: Error in GetItems,
> > sender=(null), error=Did not receive a reply. Possible causes
> include: the
> > remote application did not send a reply, the message bus security
> policy
> > blocked the reply, the reply timeout expired, or the network
> connection was
> > broken.

I already saw those warning, but as stuff were working I didn't take too
much attention. It seems that was an error ...
>
> 3. Deregistering callbacks doesn't actually deregister.
>
> Or, I don't understand what "deregister" means :-).
>
> When deregister_from_callback() is called, the return value is 'true',
> suggesting that the event has been deregistered. However, the callback
> that was supplied during the prior register_from_callback() is still
> invoked. It's as if the system is saying, "Okay, you've been
> disconnected as requested", but nonetheless keeps calling back when
> the event occurs.
>
> The way it's deregistered:
> deregistered = this._atspiEventListener.deregister_from_callback(
> _atspiFocusCB, 'object:state-changed:focused'
> );
>
> - the returned value, deregistered, is 'true'
> - the callback, _atspiFocusCB, continues to be called.
>
>

Is Alejandro Leiva using 1) 2) and 3) and working? In the same way, I
think that your work started with a python prototype written by
Joanmarie. Were that prototype using 1) 2) and 3)?

Not exactly as I mentioned before. 
 

Askingh all this but in a different way, is all this stuff working fine
on C and python but failing on _javascript_?

BTW Josep I'll love to cooperate with you in this. Is it the code publised somewhere? If you like I'll send you an email about how you are approaching this and try to write some code too.

Best Regards,
--
Alejandro Leiva


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]