Re: [gtk-list] Re: Window manager stealing coordinates ?





On Sat, 15 Nov 1997, Owen Taylor wrote:

> 
> > Hi !
> > 
> > How do I get the (x,y) coordinates of my main window ?
> > gdk_window_get_geometry() returns the correct values for
> > width, height and depth, but always the coordinates
> > (0,0). :-(
> > 
> > If I start pure X (no window manager), the correct values
> > are returned.
> > 
> > Is there a solution (working for every window manager) ?
> 
> try:
> gint          gdk_window_get_origin      (GdkWindow       *window,
>                                           gint            *x,
>                                           gint            *y);

I tried this one, and it works. 
But the windowmanager reparents toplevel windows to add
its decorations, so the x and y you get are for the inner
area of the window. Therefore, if you do a gtk_widget_set_uposition and
then a gdk_window_get_origin, you should get different values.



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