static void
position_menu (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer user_data)
{
  ShellStatusMenu *status = SHELL_STATUS_MENU (user_data);
  int src_x, src_y;

  clutter_actor_get_transformed_position (CLUTTER_ACTOR (status), &src_x, &src_y);

  *x = src_x;
  *y = src_y;
}
Exemple #2
0
static void
shell_status_menu_finalize (GObject *object)
{
  ShellStatusMenu *status = SHELL_STATUS_MENU (object);
  ShellStatusMenuPrivate *priv = status->priv;

  gconf_client_notify_remove (priv->client, priv->client_notify_lockdown_id);

  g_signal_handler_disconnect (priv->user, priv->user_notify_id);
  g_signal_handler_disconnect (priv->user, priv->user_icon_changed_id);

  if (priv->user != NULL) {
    g_object_unref (priv->user);
  }
  g_object_unref (priv->client);
  g_object_unref (priv->manager);

  G_OBJECT_CLASS (shell_status_menu_parent_class)->finalize (object);
}
Exemple #3
0
static void
position_menu (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer user_data)
{
  ShellStatusMenu *status = SHELL_STATUS_MENU (user_data);
  ClutterActor *parent;
  float src_x, src_y;
  float width, height;
  int menu_width;

  gtk_widget_get_size_request (GTK_WIDGET (menu), &menu_width, NULL);

  /* Encapsulation breakage: it looks better if the menu is
   * aligned with the bottom of the actor's grandparent - the
   * panel, rather than with the bottom of the actor. We just
   * assume what the hierarchy is and where we are positioned
   * in the panel.
   */
  parent = clutter_actor_get_parent (CLUTTER_ACTOR (status));
  parent = clutter_actor_get_parent (parent);
  clutter_actor_get_transformed_position (parent, &src_x, &src_y);
  clutter_actor_get_transformed_size (parent, &width, &height);
  *x = (gint)(0.5 + src_x + width - menu_width);
  *y = (gint)(0.5 + src_y + height);
}
Exemple #4
0
static void
on_deactivate (GtkMenuShell *menushell, gpointer user_data)
{
  ShellStatusMenu *status = SHELL_STATUS_MENU (user_data);
  g_signal_emit (G_OBJECT (status), shell_status_menu_signals[DEACTIVATED], 0);
}