Re: [g-a-devel] SPI_COORD_TYPE_WINDOW



Li,

Yes, it is the toplevel window (role: frame).  I had this feeling
of deja vu when I saw these negative (x, y) coordinates -- like I'd
read somewhere in Gtk documentation that they did this sometimes.

-Sam



-----Original Message-----
From: Li Yuan sun com [mailto:Li Yuan sun com] 
Sent: Thursday, January 08, 2009 7:02 PM
To: Quiring, Sam
Cc: gnome-accessibility-devel gnome org
Subject: Re: [g-a-devel] SPI_COORD_TYPE_WINDOW

Hi Sam,

Is the window you are getting extents from out of the toplevel window? 
Basically GAIL get these values from gdk by
gdk_window_get_frame_extents.

Li

Quiring, Sam wrote:
> Greetings,
>  
> When I call AccessibleComponent_getExtents with SPI_COORD_TYPE_WINDOW,

> some of the windows return a negative x and y coordinate, typically 
> (x, y) = (-5, -24).  I'm comparing these values to what I get back 
> from XGetWindowAttributes() for the same window.  X returns (5, 24).
>  
> When the x and y coordinates are negative, the accessible width is 10 
> more than X's width and the accessible's height is 29 more than X's 
> height.  I retrieved the _NET_FRAME_EXTENTS of the X window and I get 
> these values:
>  
> left: 5
> right: 5
> top: 5
> bottom: 24
>  
> Subtracting X's (left + right) from the accessible width yields the X 
> windows's width.
> Subtracting (top + bottom) from the accessible height yields the X 
> window's height.
>  
> For all the windows I've tested so far (a total of 5), I get this
> relationship:
>  
> If the accessible (x, y) coordinates are positive, then the (x,y) and 
> (width, height) of the accessible window will match the corresponding 
> values for the corresponding X window.
>  
> if the accessible (x, y) coordinates are negative, then make these
> transformations:
>  
>    new-x =  -x
>    new-y =  -y
>  
>    new-width = width - (left + right)
>    new-height = height - (top + bottom)
>  
> then (new-x, new-y) matches the X window (x, y) and (new-width,
> new-height) = the X window (width, height).
>  
> Do these relationships always hold?  If so, Is this documented
somewhere?
>  
> Thanks.
>  
> -Sam
> ----------------------------------------------------------------------
> --
>
> _______________________________________________
> Gnome-accessibility-devel mailing list 
> Gnome-accessibility-devel gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-accessibility-devel
>   



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