summaryrefslogtreecommitdiff
path: root/src/math-buttons.c
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2018-05-25 15:04:33 -0400
committerGitHub <[email protected]>2018-05-25 15:04:33 -0400
commit844ae4e3232ce62882f4b471930f36b7d7fbed7e (patch)
tree77eec924a551b5e781e94f5986724ac6279faa7b /src/math-buttons.c
parent0431108b7e7ee0ba72d7f2f5e6c19b906556e589 (diff)
parentd92fcabb055fb55d1cfb4b9934a0d1fd54d6b11a (diff)
downloadmate-calc-844ae4e3232ce62882f4b471930f36b7d7fbed7e.tar.bz2
mate-calc-844ae4e3232ce62882f4b471930f36b7d7fbed7e.tar.xz
Merge pull request #53 from mate-desktop/gtk_menu_popup
replace deprecated gtk_menu_popup
Diffstat (limited to 'src/math-buttons.c')
-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);
}