summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2018-05-25 16:54:20 +0200
committerraveit65 <[email protected]>2018-05-25 16:54:20 +0200
commitd92fcabb055fb55d1cfb4b9934a0d1fd54d6b11a (patch)
tree77eec924a551b5e781e94f5986724ac6279faa7b /src
parent0431108b7e7ee0ba72d7f2f5e6c19b906556e589 (diff)
downloadmate-calc-d92fcabb055fb55d1cfb4b9934a0d1fd54d6b11a.tar.bz2
mate-calc-d92fcabb055fb55d1cfb4b9934a0d1fd54d6b11a.tar.xz
replace deprecated gtk_menu_popup
Diffstat (limited to 'src')
-rw-r--r--src/math-buttons.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/src/math-buttons.c b/src/math-buttons.c
index 92c8ef1..42191ef 100644
--- a/src/math-buttons.c
+++ b/src/math-buttons.c
@@ -839,29 +839,14 @@ shift_cb(GtkWidget *widget, MathButtons *buttons)
math_equation_shift(buttons->priv->equation, GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget), "shiftcount")));
}
-
-static void
-button_menu_position_func(GtkMenu *menu, gint *x, gint *y,
- gboolean *push_in, gpointer user_data)
-{
- GtkWidget *button = user_data;
- GtkAllocation allocation;
- GdkPoint loc;
- gint border;
-
- gdk_window_get_origin(gtk_widget_get_window(button), &loc.x, &loc.y);
- border = gtk_container_get_border_width(GTK_CONTAINER(button));
- gtk_widget_get_allocation(button, &allocation);
- *x = loc.x + allocation.x + border;
- *y = loc.y + allocation.y + border;
-}
-
-
static void
popup_button_menu(GtkWidget *widget, GtkMenu *menu)
{
- gtk_menu_popup(menu, NULL, NULL,
- button_menu_position_func, widget, 1, gtk_get_current_event_time());
+ gtk_menu_popup_at_widget (menu,
+ widget,
+ GDK_GRAVITY_SOUTH_WEST,
+ GDK_GRAVITY_NORTH_WEST,
+ NULL);
}