Re: [clutter] Get the absolute screen position of an actor

From: API <apinheiro_at_igalia.com>
Date: Thu, 13 Mar 2008 09:19:23 +0100 (CET)

> API wrote:
> > I would like to know if there are a way to get the absolute screen position
> > of an actor.
> >
> > I will explain a little the context and my first attempts:
> >
> > On Gtk, you can do that with a code similar to:
> > window = gtk_widget_get_parent_window (widget); /* if the widget has a parent */
> > gdk_window_get_origin (window, &x_window, &y_window);
> >
> > But on clutter you have the next:
> > clutter_actor_get_geometry(actor, &geometry)
> >
> > But this returns the position relative to the stage (AFAIK, please correct me
> > if I'm wrong), so it starts to count from (0,0), not from the top level window
> > position.
> >
> > This problem can be workarounded if you are using the clutter stage inside a
> > GtkClutterEmbed, so you can use clutter_actor_get_geometry to get the relative
> > position, and use the gdk_window_get_origin, as I said previously, with the
> > GtkClutterEmbed to get the absolute position of the toplevel. I was able to do
> > that, and seems to work.
>
> With the X backend you can always just query the geometry of the stage
> window (which is available via clutter_x11_get_stage_window()).
Thanks for your help, as I said on my mail, I only reviewed SDL (and his
backend).

At first I will use this solution, but, this means that it is not possible
to get the same information using any other backends (SDL, EGL ...)?

Br

===
API (apinheiro_at_igalia.com)

-- 
To unsubscribe send a mail to clutter+unsubscribe_at_o-hand.com
Received on Thu Mar 13 2008 - 04:19:23 EDT

This archive was generated by hypermail 2.2.0 : Thu Mar 13 2008 - 05:00:14 EDT