diff options
author | raveit65 <[email protected]> | 2018-05-08 16:51:59 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2018-05-10 21:42:28 +0200 |
commit | c4777b09e3e2b2184895c828c05cb9f1e290fd31 (patch) | |
tree | 9b60d540fad743324f5e96b7078fa01eb4acf3b9 /eel/eel-gtk-extensions.c | |
parent | 42e5c91bee1d9f7ae88d291187f6f792c0f36145 (diff) | |
download | caja-c4777b09e3e2b2184895c828c05cb9f1e290fd31.tar.bz2 caja-c4777b09e3e2b2184895c828c05cb9f1e290fd31.tar.xz |
eel-gtk-extensions: replace deprecated gtk_menu_popup function
Diffstat (limited to 'eel/eel-gtk-extensions.c')
-rw-r--r-- | eel/eel-gtk-extensions.c | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/eel/eel-gtk-extensions.c b/eel/eel-gtk-extensions.c index e08a9e12..255aa162 100644 --- a/eel/eel-gtk-extensions.c +++ b/eel/eel-gtk-extensions.c @@ -287,43 +287,12 @@ eel_gtk_window_set_initial_geometry_from_string (GtkWindow *window, * @event: The event that invoked this popup menu. **/ void -eel_pop_up_context_menu (GtkMenu *menu, - gint16 offset_x, - gint16 offset_y, +eel_pop_up_context_menu (GtkMenu *menu, GdkEventButton *event) { - GdkPoint offset; - int button; - g_return_if_fail (GTK_IS_MENU (menu)); - offset.x = offset_x; - offset.y = offset_y; - - /* The event button needs to be 0 if we're popping up this menu from - * a button release, else a 2nd click outside the menu with any button - * other than the one that invoked the menu will be ignored (instead - * of dismissing the menu). This is a subtle fragility of the GTK menu code. - */ - - if (event) - { - button = event->type == GDK_BUTTON_RELEASE - ? 0 - : event->button; - } - else - { - button = 0; - } - - gtk_menu_popup (menu, /* menu */ - NULL, /* parent_menu_shell */ - NULL, /* parent_menu_item */ - NULL, - &offset, /* data */ - button, /* button */ - event ? event->time : GDK_CURRENT_TIME); /* activate_time */ + gtk_menu_popup_at_pointer (menu, NULL); g_object_ref_sink (menu); g_object_unref (menu); |