[gtk+/wip/attachment-parameters-3: 9/24] gtkmenu: add gtk_menu_popup_with_params ()



commit a7abac06715a3f70ba7159662e72756e62bffe16
Author: William Hua <william hua canonical com>
Date:   Fri Sep 18 16:46:44 2015 -0400

    gtkmenu: add gtk_menu_popup_with_params ()

 docs/reference/gtk/gtk3-sections.txt |    3 +
 gtk/gtkmenu.c                        |  480 +++++++++++++++++++++++++++------
 gtk/gtkmenu.h                        |   21 ++
 gtk/gtkmenuprivate.h                 |    2 +
 4 files changed, 418 insertions(+), 88 deletions(-)
---
diff --git a/docs/reference/gtk/gtk3-sections.txt b/docs/reference/gtk/gtk3-sections.txt
index 60d3eb8..5edbc38 100644
--- a/docs/reference/gtk/gtk3-sections.txt
+++ b/docs/reference/gtk/gtk3-sections.txt
@@ -2221,6 +2221,9 @@ gtk_menu_new_from_model
 gtk_menu_set_screen
 gtk_menu_reorder_child
 gtk_menu_attach
+gtk_menu_create_params
+gtk_menu_update_scroll_offset
+gtk_menu_popup_with_params
 gtk_menu_popup_for_device
 gtk_menu_popup
 gtk_menu_set_accel_group
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 61f8541..57e476b 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -1496,53 +1496,17 @@ associate_menu_grab_transfer_window (GtkMenu *menu)
   g_object_set_data (G_OBJECT (toplevel_window), I_("gdk-attached-grab-window"), transfer_window);
 }
 
-/**
- * gtk_menu_popup_for_device:
- * @menu: a #GtkMenu
- * @device: (allow-none): a #GdkDevice
- * @parent_menu_shell: (allow-none): the menu shell containing the triggering
- *     menu item, or %NULL
- * @parent_menu_item: (allow-none): the menu item whose activation triggered
- *     the popup, or %NULL
- * @func: (allow-none): a user supplied function used to position the menu,
- *     or %NULL
- * @data: (allow-none): user supplied data to be passed to @func
- * @destroy: (allow-none): destroy notify for @data
- * @button: the mouse button which was pressed to initiate the event
- * @activate_time: the time at which the activation event occurred
- *
- * Displays a menu and makes it available for selection.
- *
- * Applications can use this function to display context-sensitive menus,
- * and will typically supply %NULL for the @parent_menu_shell,
- * @parent_menu_item, @func, @data and @destroy parameters. The default
- * menu positioning function will position the menu at the current position
- * of @device (or its corresponding pointer).
- *
- * The @button parameter should be the mouse button pressed to initiate
- * the menu popup. If the menu popup was initiated by something other than
- * a mouse button press, such as a mouse button release or a keypress,
- * @button should be 0.
- *
- * The @activate_time parameter is used to conflict-resolve initiation of
- * concurrent requests for mouse/keyboard grab requests. To function
- * properly, this needs to be the time stamp of the user event (such as
- * a mouse click or key press) that caused the initiation of the popup.
- * Only if no such event is available, gtk_get_current_event_time() can
- * be used instead.
- *
- * Since: 3.0
- */
-void
-gtk_menu_popup_for_device (GtkMenu             *menu,
-                           GdkDevice           *device,
-                           GtkWidget           *parent_menu_shell,
-                           GtkWidget           *parent_menu_item,
-                           GtkMenuPositionFunc  func,
-                           gpointer             data,
-                           GDestroyNotify       destroy,
-                           guint                button,
-                           guint32              activate_time)
+static void
+gtk_menu_popup_internal (GtkMenu             *menu,
+                         GdkDevice           *device,
+                         GtkWidget           *parent_menu_shell,
+                         GtkWidget           *parent_menu_item,
+                         GtkMenuPositionFunc  func,
+                         gpointer             data,
+                         GDestroyNotify       destroy,
+                         guint                button,
+                         guint32              activate_time,
+                         GdkAttachParams     *params)
 {
   GtkMenuPrivate *priv = menu->priv;
   GtkWidget *widget;
@@ -1555,6 +1519,9 @@ gtk_menu_popup_for_device (GtkMenu             *menu,
   GdkDevice *keyboard, *pointer, *source_device = NULL;
   GdkDisplay *display;
 
+  if (params && (!GTK_IS_MENU (menu) || (device && !GDK_IS_DEVICE (device))))
+    gdk_attach_params_free (params);
+
   g_return_if_fail (GTK_IS_MENU (menu));
   g_return_if_fail (device == NULL || GDK_IS_DEVICE (device));
 
@@ -1674,6 +1641,10 @@ gtk_menu_popup_for_device (GtkMenu             *menu,
        */
       menu_shell->priv->parent_menu_shell = NULL;
       menu_grab_transfer_window_destroy (menu);
+
+      if (params)
+        gdk_attach_params_free (params);
+
       return;
     }
 
@@ -1727,6 +1698,16 @@ gtk_menu_popup_for_device (GtkMenu             *menu,
   priv->position_func_data_destroy = destroy;
   menu_shell->priv->activate_time = activate_time;
 
+  if (params != priv->attach_params)
+    {
+      if (priv->attach_params)
+        gdk_attach_params_free (priv->attach_params);
+
+      priv->attach_params = params;
+    }
+  else if (params)
+    g_warning ("%s (): menu already owns params", G_STRFUNC);
+
   /* We need to show the menu here rather in the init function
    * because code expects to be able to tell if the menu is onscreen
    * by looking at gtk_widget_get_visible (menu)
@@ -1746,6 +1727,9 @@ gtk_menu_popup_for_device (GtkMenu             *menu,
       source_device && gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHSCREEN)
     gtk_menu_shell_select_first (menu_shell, TRUE);
 
+  /* gtk_window_show () will move the menu back to (0, 0) if we don't manually clear alloc_needed */
+  _gtk_widget_set_alloc_needed (priv->toplevel, FALSE);
+
   /* Once everything is set up correctly, map the toplevel */
   gtk_widget_show (priv->toplevel);
 
@@ -1768,6 +1752,351 @@ gtk_menu_popup_for_device (GtkMenu             *menu,
 }
 
 /**
+ * gtk_menu_create_params:
+ * @menu: a #GtkMenu
+ *
+ * Creates a new #GdkAttachParams with some common parameters initialized from
+ * @menu, such as shadow width, text direction, window type, etc.
+ *
+ * Returns: (transfer full): a new #GdkAttachParams that should be freed with
+ *          gdk_attach_params_free()
+ *
+ * Since: 3.20
+ */
+GdkAttachParams *
+gtk_menu_create_params (GtkMenu *menu)
+{
+  GdkAttachParams *params = gdk_attach_params_new ();
+  GtkBorder shadow;
+  GtkTextDirection direction;
+
+  g_return_val_if_fail (GTK_IS_MENU (menu), params);
+
+  /* Compute the window size */
+  gtk_widget_show (GTK_WIDGET (menu));
+
+  /* Compute the shadow width */
+  gtk_widget_realize (menu->priv->toplevel);
+
+  _gtk_window_get_shadow_width (GTK_WINDOW (menu->priv->toplevel), &shadow);
+  gdk_attach_params_set_window_padding (params, &shadow);
+
+  direction = gtk_widget_get_direction (GTK_WIDGET (menu));
+  gdk_attach_params_set_right_to_left (params, direction == GTK_TEXT_DIR_RTL);
+
+  gdk_attach_params_set_window_type_hint (params, GDK_WINDOW_TYPE_HINT_POPUP_MENU);
+
+  return params;
+}
+
+static void
+get_arrows_border (GtkMenu   *menu,
+                   GtkBorder *border)
+{
+  GtkMenuPrivate *priv = menu->priv;
+  guint scroll_arrow_height;
+  GtkArrowPlacement arrow_placement;
+
+  gtk_widget_style_get (GTK_WIDGET (menu),
+                        "scroll-arrow-vlength", &scroll_arrow_height,
+                        "arrow_placement", &arrow_placement,
+                        NULL);
+
+  switch (arrow_placement)
+    {
+    case GTK_ARROWS_BOTH:
+      border->top = priv->upper_arrow_visible ? scroll_arrow_height : 0;
+      border->bottom = priv->lower_arrow_visible ? scroll_arrow_height : 0;
+      break;
+
+    case GTK_ARROWS_START:
+      border->top = (priv->upper_arrow_visible ||
+                     priv->lower_arrow_visible) ? scroll_arrow_height : 0;
+      border->bottom = 0;
+      break;
+
+    case GTK_ARROWS_END:
+      border->top = 0;
+      border->bottom = (priv->upper_arrow_visible ||
+                        priv->lower_arrow_visible) ? scroll_arrow_height : 0;
+      break;
+    }
+
+  border->left = border->right = 0;
+}
+
+/**
+ * gtk_menu_update_scroll_offset:
+ * @window: the #GdkWindow that was moved
+ * @params: (nullable): the #GdkAttachParams that was used
+ * @position: (nullable): the final position of @window
+ * @offset: (nullable): the displacement applied to keep @window on-screen
+ * @primary_rule: the primary rule that was used for positioning. If unknown,
+ *                pass %GDK_ATTACH_UNKNOWN
+ * @secondary_rule: the secondary rule that was used for positioning. If
+ *                  unknown, pass %GDK_ATTACH_UNKNOWN
+ * @user_data: (not nullable): the #GtkMenu whose scroll offset should be
+ *             updated
+ *
+ * Updates the scroll offset for the #GtkMenu @user_data. This function has
+ * type #GdkAttachCallback and can be passed to
+ * gdk_attach_params_set_position_callback().
+ *
+ * Since: 3.20
+ */
+void
+gtk_menu_update_scroll_offset (GdkWindow             *window,
+                               const GdkAttachParams *params,
+                               const GdkPoint        *position,
+                               const GdkPoint        *offset,
+                               GdkAttachRule          primary_rule,
+                               GdkAttachRule          secondary_rule,
+                               gpointer               user_data)
+{
+  GtkMenu *menu;
+  GtkBorder border;
+
+  g_return_if_fail (GTK_IS_MENU (user_data));
+
+  if (!offset || !offset->y)
+    return;
+
+  menu = user_data;
+
+  get_arrows_border (menu, &border);
+
+  menu->priv->scroll_offset = offset->y + border.top;
+  gtk_menu_scroll_to (menu, menu->priv->scroll_offset);
+}
+
+static void
+set_attachment_widget (GdkAttachParams *params,
+                       GtkWidget       *widget)
+{
+  GdkWindow *window;
+  GdkPoint origin = { 0 };
+  GtkAllocation allocation;
+
+  g_return_if_fail (params);
+
+  if (!widget)
+    return;
+
+  window = gtk_widget_get_window (widget);
+
+  if (window)
+    gdk_window_get_root_origin (window, &origin.x, &origin.y);
+
+  gtk_widget_get_allocation (widget, &allocation);
+  gdk_window_get_root_coords (window, allocation.x, allocation.y, &allocation.x, &allocation.y);
+  allocation.x -= origin.x;
+  allocation.y -= origin.y;
+
+  gdk_attach_params_set_attach_origin (params, &origin);
+  gdk_attach_params_set_attach_rect (params, &allocation);
+}
+
+/**
+ * gtk_menu_popup_with_params:
+ * @menu: a #GtkMenu
+ * @device: (transfer none) (nullable): a #GdkDevice
+ * @parent_menu_shell: (transfer none) (nullable): the menu shell containing
+ *                     the triggering menu item or %NULL
+ * @attachment_widget: (transfer none) (nullable): the widget to attach @menu
+ *                     to
+ * @button: the mouse button which was pressed to initiate the event
+ * @activate_time: the time at which the activation event occurred
+ * @params: (transfer full) (nullable): a description of how to position @menu
+ *
+ * Displays a menu and makes it available for selection.
+ *
+ * Applications can use this function to display context-sensitive menus,
+ * and will typically supply %NULL for the @parent_menu_shell. The default
+ * menu positioning function will position the menu at the current position
+ * of @device (or its corresponding pointer).
+ *
+ * The @menu will be popped up beside @attachment_widget, using the details
+ * supplied in @params. Usually, you create @params using
+ * gtk_menu_create_params(), which initializes the structure with some
+ * common parameters that can be derived from @menu.
+ *
+ * The @button parameter should be the mouse button pressed to initiate
+ * the menu popup. If the menu popup was initiated by something other than
+ * a mouse button press, such as a mouse button release or a keypress,
+ * @button should be 0.
+ *
+ * The @activate_time parameter is used to conflict-resolve initiation of
+ * concurrent requests for mouse/keyboard grab requests. To function
+ * properly, this needs to be the time stamp of the user event (such as
+ * a mouse click or key press) that caused the initiation of the popup.
+ * Only if no such event is available, gtk_get_current_event_time() can
+ * be used instead.
+ *
+ * Since: 3.20
+ */
+void
+gtk_menu_popup_with_params (GtkMenu         *menu,
+                            GdkDevice       *device,
+                            GtkWidget       *parent_menu_shell,
+                            GtkWidget       *attachment_widget,
+                            guint            button,
+                            guint32          activate_time,
+                            GdkAttachParams *params)
+{
+  GdkDisplay *display;
+  GdkDeviceManager *manager;
+  GList *devices;
+  GdkDevice *pointer;
+  GdkRectangle rectangle;
+
+  if (params && !GTK_IS_MENU (menu))
+    gdk_attach_params_free (params);
+
+  g_return_if_fail (GTK_IS_MENU (menu));
+
+  if (!params)
+    {
+      params = gtk_menu_create_params (menu);
+
+      if (attachment_widget)
+        {
+          gdk_attach_params_add_primary_rules (params,
+                                               GDK_ATTACH_AXIS_Y | GDK_ATTACH_RECT_MAX | 
GDK_ATTACH_WINDOW_MIN,
+                                               GDK_ATTACH_AXIS_Y | GDK_ATTACH_RECT_MIN | 
GDK_ATTACH_WINDOW_MAX,
+                                               GDK_ATTACH_AXIS_X | GDK_ATTACH_RECT_MAX | 
GDK_ATTACH_WINDOW_MIN | GDK_ATTACH_FLIP_IF_RTL,
+                                               GDK_ATTACH_AXIS_X | GDK_ATTACH_RECT_MIN | 
GDK_ATTACH_WINDOW_MAX | GDK_ATTACH_FLIP_IF_RTL,
+                                               NULL);
+
+          gdk_attach_params_add_secondary_rules (params,
+                                                 GDK_ATTACH_AXIS_X | GDK_ATTACH_RECT_MIN | 
GDK_ATTACH_WINDOW_MIN | GDK_ATTACH_FLIP_IF_RTL,
+                                                 GDK_ATTACH_AXIS_X | GDK_ATTACH_RECT_MAX | 
GDK_ATTACH_WINDOW_MAX | GDK_ATTACH_FLIP_IF_RTL,
+                                                 GDK_ATTACH_AXIS_Y | GDK_ATTACH_RECT_MIN | 
GDK_ATTACH_WINDOW_MIN,
+                                                 GDK_ATTACH_AXIS_Y | GDK_ATTACH_RECT_MAX | 
GDK_ATTACH_WINDOW_MAX,
+                                                 NULL);
+        }
+      else
+        {
+          display = gtk_widget_get_display (GTK_WIDGET (menu));
+
+          if (device == NULL)
+            device = gtk_get_current_event_device ();
+
+          if (device && gdk_device_get_display (device) != display)
+            device = NULL;
+
+          if (device == NULL)
+            {
+              manager = gdk_display_get_device_manager (display);
+              devices = gdk_device_manager_list_devices (manager, GDK_DEVICE_TYPE_MASTER);
+              device = devices->data;
+              g_list_free (devices);
+            }
+
+          if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD)
+            pointer = gdk_device_get_associated_device (device);
+          else
+            pointer = device;
+
+          gdk_device_get_position (pointer, NULL, &rectangle.x, &rectangle.y);
+          rectangle.width = 1;
+          rectangle.height = 1;
+
+          gdk_attach_params_set_attach_rect (params, &rectangle);
+
+          gdk_attach_params_add_primary_rules (params,
+                                               GDK_ATTACH_AXIS_Y | GDK_ATTACH_RECT_MAX | 
GDK_ATTACH_WINDOW_MIN,
+                                               GDK_ATTACH_AXIS_Y | GDK_ATTACH_RECT_MIN | 
GDK_ATTACH_WINDOW_MAX,
+                                               GDK_ATTACH_AXIS_X | GDK_ATTACH_RECT_MAX | 
GDK_ATTACH_WINDOW_MIN | GDK_ATTACH_FLIP_IF_RTL,
+                                               GDK_ATTACH_AXIS_X | GDK_ATTACH_RECT_MIN | 
GDK_ATTACH_WINDOW_MAX | GDK_ATTACH_FLIP_IF_RTL,
+                                               NULL);
+
+          gdk_attach_params_add_secondary_rules (params,
+                                                 GDK_ATTACH_AXIS_X | GDK_ATTACH_RECT_MAX | 
GDK_ATTACH_WINDOW_MIN | GDK_ATTACH_FLIP_IF_RTL,
+                                                 GDK_ATTACH_AXIS_X | GDK_ATTACH_RECT_MIN | 
GDK_ATTACH_WINDOW_MAX | GDK_ATTACH_FLIP_IF_RTL,
+                                                 GDK_ATTACH_AXIS_Y | GDK_ATTACH_RECT_MAX | 
GDK_ATTACH_WINDOW_MIN,
+                                                 GDK_ATTACH_AXIS_Y | GDK_ATTACH_RECT_MIN | 
GDK_ATTACH_WINDOW_MAX,
+                                                 NULL);
+        }
+    }
+
+  if (attachment_widget)
+    set_attachment_widget (params, attachment_widget);
+
+  gtk_menu_popup_internal (menu,
+                           device,
+                           parent_menu_shell,
+                           NULL,
+                           NULL,
+                           NULL,
+                           NULL,
+                           button,
+                           activate_time,
+                           params);
+}
+
+/**
+ * gtk_menu_popup_for_device:
+ * @menu: a #GtkMenu
+ * @device: (allow-none): a #GdkDevice
+ * @parent_menu_shell: (allow-none): the menu shell containing the triggering
+ *     menu item, or %NULL
+ * @parent_menu_item: (allow-none): the menu item whose activation triggered
+ *     the popup, or %NULL
+ * @func: (allow-none): a user supplied function used to position the menu,
+ *     or %NULL
+ * @data: (allow-none): user supplied data to be passed to @func
+ * @destroy: (allow-none): destroy notify for @data
+ * @button: the mouse button which was pressed to initiate the event
+ * @activate_time: the time at which the activation event occurred
+ *
+ * Displays a menu and makes it available for selection.
+ *
+ * Applications can use this function to display context-sensitive menus,
+ * and will typically supply %NULL for the @parent_menu_shell,
+ * @parent_menu_item, @func, @data and @destroy parameters. The default
+ * menu positioning function will position the menu at the current position
+ * of @device (or its corresponding pointer).
+ *
+ * The @button parameter should be the mouse button pressed to initiate
+ * the menu popup. If the menu popup was initiated by something other than
+ * a mouse button press, such as a mouse button release or a keypress,
+ * @button should be 0.
+ *
+ * The @activate_time parameter is used to conflict-resolve initiation of
+ * concurrent requests for mouse/keyboard grab requests. To function
+ * properly, this needs to be the time stamp of the user event (such as
+ * a mouse click or key press) that caused the initiation of the popup.
+ * Only if no such event is available, gtk_get_current_event_time() can
+ * be used instead.
+ *
+ * Since: 3.0
+ */
+void
+gtk_menu_popup_for_device (GtkMenu             *menu,
+                           GdkDevice           *device,
+                           GtkWidget           *parent_menu_shell,
+                           GtkWidget           *parent_menu_item,
+                           GtkMenuPositionFunc  func,
+                           gpointer             data,
+                           GDestroyNotify       destroy,
+                           guint                button,
+                           guint32              activate_time)
+{
+  g_return_if_fail (GTK_IS_MENU (menu));
+
+  gtk_menu_popup_internal (menu,
+                           device,
+                           parent_menu_shell,
+                           parent_menu_item,
+                           func,
+                           data,
+                           destroy,
+                           button,
+                           activate_time,
+                           NULL);
+}
+
+/**
  * gtk_menu_popup:
  * @menu: a #GtkMenu
  * @parent_menu_shell: (allow-none): the menu shell containing the
@@ -2493,42 +2822,6 @@ gtk_menu_reorder_child (GtkMenu   *menu,
 }
 
 static void
-get_arrows_border (GtkMenu   *menu,
-                   GtkBorder *border)
-{
-  GtkMenuPrivate *priv = menu->priv;
-  guint scroll_arrow_height;
-  GtkArrowPlacement arrow_placement;
-
-  gtk_widget_style_get (GTK_WIDGET (menu),
-                        "scroll-arrow-vlength", &scroll_arrow_height,
-                        "arrow_placement", &arrow_placement,
-                        NULL);
-
-  switch (arrow_placement)
-    {
-    case GTK_ARROWS_BOTH:
-      border->top = priv->upper_arrow_visible ? scroll_arrow_height : 0;
-      border->bottom = priv->lower_arrow_visible ? scroll_arrow_height : 0;
-      break;
-
-    case GTK_ARROWS_START:
-      border->top = (priv->upper_arrow_visible ||
-                     priv->lower_arrow_visible) ? scroll_arrow_height : 0;
-      border->bottom = 0;
-      break;
-
-    case GTK_ARROWS_END:
-      border->top = 0;
-      border->bottom = (priv->upper_arrow_visible ||
-                        priv->lower_arrow_visible) ? scroll_arrow_height : 0;
-      break;
-    }
-
-  border->left = border->right = 0;
-}
-
-static void
 get_menu_padding (GtkWidget *widget,
                   GtkBorder *padding)
 {
@@ -4461,6 +4754,7 @@ gtk_menu_position (GtkMenu  *menu,
                    gboolean  set_scroll_offset)
 {
   GtkMenuPrivate *priv = menu->priv;
+  GdkWindowTypeHint hint;
   GtkWidget *widget;
   GtkRequisition requisition;
   gint x, y;
@@ -4471,17 +4765,27 @@ gtk_menu_position (GtkMenu  *menu,
   GdkDevice *pointer;
   GtkBorder border;
 
+  /* Realize so we have the proper width and height to figure out
+   * the right place to popup the menu. */
+  gtk_widget_realize (priv->toplevel);
+
+  if (!gtk_widget_get_mapped (priv->toplevel) && priv->attach_params)
+    {
+      hint = gdk_attach_params_get_window_type_hint (priv->attach_params);
+      gtk_window_set_type_hint (GTK_WINDOW (priv->toplevel), hint);
+    }
+
+  gdk_window_set_attach_params (gtk_widget_get_window (priv->toplevel), priv->attach_params);
+
+  if (priv->attach_params)
+    return;
+
   widget = GTK_WIDGET (menu);
 
   screen = gtk_widget_get_screen (widget);
   pointer = _gtk_menu_shell_get_grab_device (GTK_MENU_SHELL (menu));
   gdk_device_get_position (pointer, &pointer_screen, &x, &y);
 
-  /* Realize so we have the proper width and height to figure out
-   * the right place to popup the menu.
-   */
-  gtk_widget_realize (priv->toplevel);
-
   _gtk_window_get_shadow_width (GTK_WINDOW (priv->toplevel), &border);
 
   requisition.width = gtk_widget_get_allocated_width (widget);
diff --git a/gtk/gtkmenu.h b/gtk/gtkmenu.h
index bf81a89..63b7dbc 100644
--- a/gtk/gtkmenu.h
+++ b/gtk/gtkmenu.h
@@ -155,6 +155,27 @@ void       gtk_menu_popup_for_device      (GtkMenu             *menu,
                                            guint                button,
                                            guint32              activate_time);
 
+GDK_AVAILABLE_IN_3_20
+GdkAttachParams * gtk_menu_create_params  (GtkMenu             *menu);
+
+GDK_AVAILABLE_IN_3_20
+void       gtk_menu_update_scroll_offset  (GdkWindow             *window,
+                                           const GdkAttachParams *params,
+                                           const GdkPoint        *position,
+                                           const GdkPoint        *offset,
+                                           GdkAttachRule          primary_rule,
+                                           GdkAttachRule          secondary_rule,
+                                           gpointer               user_data);
+
+GDK_AVAILABLE_IN_3_20
+void       gtk_menu_popup_with_params     (GtkMenu               *menu,
+                                           GdkDevice             *device,
+                                           GtkWidget             *parent_menu_shell,
+                                           GtkWidget             *attachment_widget,
+                                           guint                  button,
+                                           guint32                activate_time,
+                                           GdkAttachParams       *params);
+
 /* Position the menu according to its position function. Called
  * from gtkmenuitem.c when a menu-item changes its allocation
  */
diff --git a/gtk/gtkmenuprivate.h b/gtk/gtkmenuprivate.h
index f1a40d8..eb1cdc6 100644
--- a/gtk/gtkmenuprivate.h
+++ b/gtk/gtkmenuprivate.h
@@ -51,6 +51,8 @@ struct _GtkMenuPrivate
   gint                position_x;
   gint                position_y;
 
+  GdkAttachParams *attach_params;
+
   guint toggle_size;
   guint accel_size;
 


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