Alex, Thanks for the response. Unfortunately I do not always see a window with state SPI_STATE_ACTIVE. Maybe there is an explanation for why this is, but I do not know it. Here's what I do:
1. In a terminal window I run my test program which sets up some event handlers and runs SPI_event_main(). 2. I already have Firefox running with the URL http://www.weather.com, but it is partially hidden by my terminal window 3. Using the mouse I click on the Firefox button in the bottom panel (task panel?) of my desktop - this brings the Firefox window to the top. 4. I hover the mouse over the "Site" radio button in 'The Weather Channel' search box. 5. I press F8 which triggers a listener in my app 6. My application examines (through at-spi) the desktop and all apps on the desktop 7. It finds 4 applications with child windows containing the mouse (the apps are Firefox, two Terminal windows, and the desktop itself). 8. None of those child windows have state SPI_STATE_ACTIVE. If, instead of step 5 (press F8), I click the radio button with the mouse, then I do see that a child window of Firefox has the state SPI_STATE_ACTIVE. However, for my purposes I can't always use mouse clicks. For example, if the user clicks the "close" button of a dialog, then by the time my app is trying to figure out what widget was clicked, the window is gone. -Sam -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Hao Yu - ?? Sent: Sunday, January 04, 2009 6:16 PM To: [email protected] Subject: Re: [g-a-devel] Which window is on top? (Alex) Hi, Sam *...@spi_state_active: Indicates a window is currently the active window Is this what you want? Regards, Alex -----邮件原件----- 发件人: [email protected] [mailto:[email protected]] 代表 [email protected] 发送时间: 2009年1月3日 20:00 收件人: [email protected] 主题: Gnome-accessibility-devel Digest, Vol 56, Issue 3 Send Gnome-accessibility-devel mailing list submissions to [email protected] To subscribe or unsubscribe via the World Wide Web, visit http://mail.gnome.org/mailman/listinfo/gnome-accessibility-devel or, via email, send a message with subject or body 'help' to [email protected] You can reach the person managing the list at [email protected] When replying, please edit your Subject line so it is more specific than "Re: Contents of Gnome-accessibility-devel digest..." Today's Topics: 1. Re: Which window is on top? (Quiring, Sam) 2. Re: Which window is on top? (David Bolter) 3. Re: Which window is on top? (Steve Lee) 4. Re: Which window is on top? (Samuel Thibault) 5. Re: Which window is on top? (Quiring, Sam) ---------------------------------------------------------------------- Message: 1 Date: Fri, 2 Jan 2009 10:25:57 -0800 From: "Quiring, Sam" <[email protected]> Subject: Re: [g-a-devel] Which window is on top? To: "Steve Lee" <[email protected]> Cc: [email protected] Message-ID: <f25aac0bd4afcb4ebba2f22fc65c07c801594...@ala-mail02.corp.ad.wrs.com> Content-Type: text/plain; charset="us-ascii" Steve, thanks for your reply. I called gtk_init(null, null) and then tried using gdk_display_get_window_at_pointer() and gdk_window_at_pointer(), both returned null, which I'm interpretting as "that window belongs to a different application -- you do not have access". I decided to drop down to XWindows. I have been able to find the XWindow under the mouse and match its geometry (x, y, width, height) with the Accessible *window obtained from ap-spi, so this might work. Of course if there happened to be multiple identical windows at the same spot, I would not be able to distinguish them. This brings up two questions: 1. Is there a way to map from an at-spi Accessible *value to its associated XWindow window? 2. Is there a better alternative than XWindows for doing this? Thanks. -Sam -----Original Message----- From: Steve Lee [mailto:[email protected]] Sent: Friday, January 02, 2009 1:52 AM To: Quiring, Sam Cc: [email protected] Subject: Re: [g-a-devel] Which window is on top? 2008/12/31 Quiring, Sam <[email protected]>: > I cannot find a way to figure out what window is on top nor the zorder > relationship of the windows. Sam, this is something where you may need to look outside the a11y API. e.g the windows manager Happy new year -- Steve Lee Open Source Assistive Technology Software and Accessibility fullmeasure.co.uk ------------------------------ Message: 2 Date: Fri, 02 Jan 2009 13:49:42 -0500 From: David Bolter <[email protected]> Subject: Re: [g-a-devel] Which window is on top? To: "Quiring, Sam" <[email protected]> Cc: [email protected] Message-ID: <[email protected]> Content-Type: text/plain; charset=ISO-8859-1 Hi Sam (and hi Steve) You might find libwnck useful: http://library.gnome.org/devel/libwnck/stable/WnckWindow.html#wnck-window-is-above (and wnck_window_is_below) Note you could use libwnck API... or find out how it is implemented under the hood :) cheers, David Quiring, Sam wrote: > Steve, thanks for your reply. > > I called gtk_init(null, null) and then tried using > gdk_display_get_window_at_pointer() and gdk_window_at_pointer(), both > returned null, which I'm interpretting as "that window belongs to a > different application -- you do not have access". > > I decided to drop down to XWindows. I have been able to find the > XWindow under the mouse and match its geometry (x, y, width, height) > with the Accessible *window obtained from ap-spi, so this might work. > Of course if there happened to be multiple identical windows at the > same spot, I would not be able to distinguish them. > > This brings up two questions: > > 1. Is there a way to map from an at-spi Accessible *value to its > associated XWindow window? > 2. Is there a better alternative than XWindows for doing this? > > Thanks. > > -Sam > > -----Original Message----- > From: Steve Lee [mailto:[email protected]] > Sent: Friday, January 02, 2009 1:52 AM > To: Quiring, Sam > Cc: [email protected] > Subject: Re: [g-a-devel] Which window is on top? > > 2008/12/31 Quiring, Sam <[email protected]>: > >> I cannot find a way to figure out what window is on top nor the >> zorder >> > > >> relationship of the windows. >> > > Sam, this is something where you may need to look outside the a11y API. > e.g the windows manager > > Happy new year > -- > Steve Lee > Open Source Assistive Technology Software and Accessibility > fullmeasure.co.uk _______________________________________________ > Gnome-accessibility-devel mailing list > [email protected] > http://mail.gnome.org/mailman/listinfo/gnome-accessibility-devel > ------------------------------ Message: 3 Date: Fri, 2 Jan 2009 19:22:45 +0000 From: "Steve Lee" <[email protected]> Subject: Re: [g-a-devel] Which window is on top? To: "David Bolter" <[email protected]> Cc: [email protected], "Quiring, Sam" <[email protected]> Message-ID: <[email protected]> Content-Type: text/plain; charset=ISO-8859-1 Thanks David. I knew there was a library we used in Python for accessing WM features that had a strange name. Yep, that's the one. Steve 2009/1/2 David Bolter <[email protected]>: > Hi Sam (and hi Steve) > > You might find libwnck useful: > > http://library.gnome.org/devel/libwnck/stable/WnckWindow.html#wnck-win > dow-is-above > (and wnck_window_is_below) > > Note you could use libwnck API... or find out how it is implemented > under the hood :) > > cheers, > David > > Quiring, Sam wrote: >> Steve, thanks for your reply. >> >> I called gtk_init(null, null) and then tried using >> gdk_display_get_window_at_pointer() and gdk_window_at_pointer(), both >> returned null, which I'm interpretting as "that window belongs to a >> different application -- you do not have access". >> >> I decided to drop down to XWindows. I have been able to find the >> XWindow under the mouse and match its geometry (x, y, width, height) >> with the Accessible *window obtained from ap-spi, so this might work. >> Of course if there happened to be multiple identical windows at the >> same spot, I would not be able to distinguish them. >> >> This brings up two questions: >> >> 1. Is there a way to map from an at-spi Accessible *value to its >> associated XWindow window? >> 2. Is there a better alternative than XWindows for doing this? >> >> Thanks. >> >> -Sam >> >> -----Original Message----- >> From: Steve Lee [mailto:[email protected]] >> Sent: Friday, January 02, 2009 1:52 AM >> To: Quiring, Sam >> Cc: [email protected] >> Subject: Re: [g-a-devel] Which window is on top? >> >> 2008/12/31 Quiring, Sam <[email protected]>: >> >>> I cannot find a way to figure out what window is on top nor the >>> zorder >>> >> >> >>> relationship of the windows. >>> >> >> Sam, this is something where you may need to look outside the a11y API. >> e.g the windows manager >> >> Happy new year >> -- >> Steve Lee >> Open Source Assistive Technology Software and Accessibility >> fullmeasure.co.uk _______________________________________________ >> Gnome-accessibility-devel mailing list >> [email protected] >> http://mail.gnome.org/mailman/listinfo/gnome-accessibility-devel >> > > -- Steve Lee Open Source Assistive Technology Software and Accessibility fullmeasure.co.uk ------------------------------ Message: 4 Date: Fri, 2 Jan 2009 21:25:29 +0100 From: Samuel Thibault <[email protected]> Subject: Re: [g-a-devel] Which window is on top? To: "Quiring, Sam" <[email protected]> Cc: [email protected] Message-ID: <20090102202529.ga26...@const> Content-Type: text/plain; charset=iso-8859-1 Hello, Quiring, Sam, le Fri 02 Jan 2009 10:25:57 -0800, a ?crit : > 1. Is there a way to map from an at-spi Accessible *value to its > associated XWindow window? I precisely asked for an API to get this information some time ago, but it was rejected because it was said that AT-SPI engines shouldn't assume that the desktop is an X-Window desktop. So there is currently no way except the kind of tinkering you have figured out. Samuel ------------------------------ Message: 5 Date: Fri, 2 Jan 2009 13:24:09 -0800 From: "Quiring, Sam" <[email protected]> Subject: Re: [g-a-devel] Which window is on top? To: "Samuel Thibault" <[email protected]> Cc: [email protected] Message-ID: <f25aac0bd4afcb4ebba2f22fc65c07c801594...@ala-mail02.corp.ad.wrs.com> Content-Type: text/plain; charset="iso-8859-1" Samuel, = it was rejected because it was said that AT-SPI engines shouldn't assume that the desktop is an X-Window desktop. I'm ok with the rejection as long as I can use AT-SPI for everything. But now that I have to use the underlying window manager to figure out which window is on top, I'm with you: it would be nice to be able to map AT-SPI windows to window manager windows, whether it's X or WIN32 or whatever. -Sam -----Original Message----- From: Samuel Thibault [mailto:[email protected]] Sent: Friday, January 02, 2009 12:25 PM To: Quiring, Sam Cc: Steve Lee; [email protected] Subject: Re: [g-a-devel] Which window is on top? Hello, Quiring, Sam, le Fri 02 Jan 2009 10:25:57 -0800, a ?crit : > 1. Is there a way to map from an at-spi Accessible *value to its > associated XWindow window? I precisely asked for an API to get this information some time ago, but it was rejected because it was said that AT-SPI engines shouldn't assume that the desktop is an X-Window desktop. So there is currently no way except the kind of tinkering you have figured out. Samuel ------------------------------ _______________________________________________ Gnome-accessibility-devel mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gnome-accessibility-devel End of Gnome-accessibility-devel Digest, Vol 56, Issue 3 ******************************************************** _______________________________________________ Gnome-accessibility-devel mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gnome-accessibility-devel _______________________________________________ Gnome-accessibility-devel mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gnome-accessibility-devel
