diff options
author | raveit65 <[email protected]> | 2019-07-20 18:31:20 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2022-07-20 18:56:55 +0200 |
commit | 17a774a70b2081c17807a04b6e72be322bbf1708 (patch) | |
tree | a44b40579dd965de1da8f44558e362929b68b25a /src | |
parent | 082ef784c77646d0f6b8988a87c4d2fea36fa867 (diff) | |
download | caja-17a774a70b2081c17807a04b6e72be322bbf1708.tar.bz2 caja-17a774a70b2081c17807a04b6e72be322bbf1708.tar.xz |
spatial-window: replace geprecated gtk_menu_popup
Diffstat (limited to 'src')
-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 52bd6d39..17a3a892 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); |