diff options
author | raveit65 <[email protected]> | 2018-05-09 20:54:31 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2018-05-09 20:54:31 +0200 |
commit | 4921909a4c2939273a6d00d962f48f97a518346e (patch) | |
tree | ed845f1a8644c4b65a0a783154fe691b06a1a231 | |
parent | 04e564c74159cf3537c9aae2110f66474e46b3a2 (diff) | |
download | marco-4921909a4c2939273a6d00d962f48f97a518346e.tar.bz2 marco-4921909a4c2939273a6d00d962f48f97a518346e.tar.xz |
ui: replace deprecated gtk_menu_popupgtk_meu_popup
-rw-r--r-- | src/ui/menu.c | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/src/ui/menu.c b/src/ui/menu.c index aeba64fa..01f09c55 100644 --- a/src/ui/menu.c +++ b/src/ui/menu.c @@ -100,28 +100,6 @@ static MenuItem menuitems[] = { {META_MENU_OP_DELETE, MENU_ITEM_IMAGE, MARCO_STOCK_DELETE, FALSE, N_("_Close")} }; -static void popup_position_func(GtkMenu* menu, gint* x, gint* y, gboolean* push_in, gpointer user_data) -{ - GtkRequisition req; - GdkPoint* pos; - - pos = user_data; - - gtk_widget_get_preferred_size (GTK_WIDGET (menu), &req, NULL); - - *x = pos->x; - *y = pos->y; - - if (meta_ui_get_direction() == META_UI_DIRECTION_RTL) - { - *x = MAX (0, *x - req.width); - } - - /* Ensure onscreen */ - *x = CLAMP (*x, 0, MAX(0, WidthOfScreen (gdk_x11_screen_get_xscreen (gdk_screen_get_default ())) - req.width)); - *y = CLAMP (*y, 0, MAX(0, HeightOfScreen (gdk_x11_screen_get_xscreen (gdk_screen_get_default ())) - req.height)); -} - static void menu_closed(GtkMenu* widget, gpointer data) { MetaWindowMenu *menu; @@ -498,7 +476,7 @@ void meta_window_menu_popup(MetaWindowMenu* menu, int root_x, int root_y, int bu pt->x = root_x / scale; pt->y = root_y / scale; - gtk_menu_popup(GTK_MENU (menu->menu), NULL, NULL, popup_position_func, pt, button, timestamp); + gtk_menu_popup_at_pointer (GTK_MENU (menu->menu), NULL); if (!gtk_widget_get_visible (menu->menu)) meta_warning("GtkMenu failed to grab the pointer\n"); |