コード例 #1
0
static void
shell_gtk_window_actor_allocate (ClutterActor          *actor,
                                 const ClutterActorBox *box,
                                 gboolean               absolute_origin_changed)
{
  ShellGtkWindowActor *wactor = SHELL_GTK_WINDOW_ACTOR (actor);
  int wx = 0, wy = 0, x, y, ax, ay;

  CLUTTER_ACTOR_CLASS (shell_gtk_window_actor_parent_class)->
    allocate (actor, box, absolute_origin_changed);

  /* Find the actor's new coordinates in terms of the stage (which is
   * priv->window's parent window.
   */
  while (actor)
    {
      clutter_actor_get_position (actor, &x, &y);
      clutter_actor_get_anchor_point (actor, &ax, &ay);

      wx += x - ax;
      wy += y - ay;

      actor = clutter_actor_get_parent (actor);
    }

  gtk_window_move (GTK_WINDOW (wactor->priv->window), wx, wy);
}
コード例 #2
0
static void
cinnamon_gtk_embed_allocate (ClutterActor          *actor,
                          const ClutterActorBox *box,
                          ClutterAllocationFlags flags)
{
  CinnamonGtkEmbed *embed = CINNAMON_GTK_EMBED (actor);
  float wx = 0.0, wy = 0.0, x, y, ax, ay;

  CLUTTER_ACTOR_CLASS (cinnamon_gtk_embed_parent_class)->
    allocate (actor, box, flags);

  /* Find the actor's new coordinates in terms of the stage (which is
   * priv->window's parent window.
   */
  while (actor)
    {
      clutter_actor_get_position (actor, &x, &y);
      clutter_actor_get_anchor_point (actor, &ax, &ay);

      wx += x - ax;
      wy += y - ay;

      actor = clutter_actor_get_parent (actor);
    }

  _cinnamon_embedded_window_allocate (embed->priv->window,
                                   (int)(0.5 + wx), (int)(0.5 + wy),
                                   box->x2 - box->x1,
                                   box->y2 - box->y1);
}