Re: [g-a-devel]accessible state of foreground application



David Bolter wrote:
> ...
> i am currently trying to figure out the right way to get the Accessible*
> to the foreground application (without having to trigger on an event).
> i was wondering if i could count on the foreground application to have
> the SPI_STATE_ACTIVE state (if not now - then in the future?).  if i am
> going about this all wrong please call me on it ;-)

I think that I was unclear here; the objects which have state such as
SPI_STATE_ACTIVE are not the applications (since in a truly multitasking
operating system there is no "foreground application) but the toplevel
windows.  Applications typically have toplevel windows as children.

So if you want to find the state of a toplevel window you must query the 
applications for their children, and get the states of those children.

Again, not the approach I would recommend, since you might have to do
a lot of querying.  On the other hand, if you registered listeners for
the state changes, you would always know the foreground/currently
focussed window.

It is possible, given the semantics of SPI_STATE_ACTIVE, that there 
might be more than one window active when queried; also keep race
conditions in mind, the window may have changed state since your query!

An event based model has a number of advantages, I believe.

-Bill



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