diff options
author | raveit65 <[email protected]> | 2019-07-20 18:31:20 +0200 |
---|---|---|
committer | lukefromdc <[email protected]> | 2019-07-23 01:50:21 +0000 |
commit | ca1c1db2b68a643d0d4d743e8ac65a8021fe0c35 (patch) | |
tree | bbcc5b9b59d7cd12490ba8ae639cf388505b9696 /src/caja-spatial-window.c | |
parent | f6270a92e515630cde164c2312be9ef7c69e92b1 (diff) | |
download | caja-ca1c1db2b68a643d0d4d743e8ac65a8021fe0c35.tar.bz2 caja-ca1c1db2b68a643d0d4d743e8ac65a8021fe0c35.tar.xz |
spatial-window: replace geprecated gtk_menu_popup
Diffstat (limited to 'src/caja-spatial-window.c')
-rw-r--r-- | src/caja-spatial-window.c | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/src/caja-spatial-window.c b/src/caja-spatial-window.c index 79a7d18a..1011ad24 100644 --- a/src/caja-spatial-window.c +++ b/src/caja-spatial-window.c @@ -601,32 +601,6 @@ menu_deactivate_callback (GtkWidget *menu, } } -static void -menu_popup_pos (GtkMenu *menu, - gint *x, - gint *y, - gboolean *push_in, - gpointer user_data) -{ - GtkWidget *widget; - GtkRequisition menu_requisition, button_requisition; - GtkAllocation allocation; - - widget = user_data; - - gtk_widget_get_preferred_size (GTK_WIDGET (menu), &menu_requisition, NULL); - gtk_widget_get_preferred_size (widget, &button_requisition, NULL); - gtk_widget_get_allocation (widget, &allocation); - - gdk_window_get_origin (gtk_widget_get_window (widget), x, y); - *x += allocation.x; - *y += allocation.y; - - *y -= menu_requisition.height - button_requisition.height; - - *push_in = TRUE; -} - static gboolean location_button_pressed_callback (GtkWidget *widget, GdkEventButton *event, @@ -741,7 +715,12 @@ location_button_clicked_callback (GtkWidget *widget, loop); gtk_grab_add (popup); - gtk_menu_popup (GTK_MENU (popup), NULL, NULL, menu_popup_pos, widget, 1, GDK_CURRENT_TIME); + gtk_menu_popup_at_widget (GTK_MENU (popup), + widget, + GDK_GRAVITY_SOUTH_WEST, + GDK_GRAVITY_NORTH_WEST, + NULL); + gtk_menu_shell_select_item (GTK_MENU_SHELL (popup), first_item); g_main_loop_run (loop); gtk_grab_remove (popup); |