diff options
author | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-05 22:27:52 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-06 08:19:09 -0300 |
commit | 8cf0584e57b58929eabad41b43a05812a0cdc377 (patch) | |
tree | 8e90064dd1ee76c8a94e56c6c4412d6ddd27221b | |
parent | d59975bd3666dc71c2df59a90785c64722524576 (diff) |
gtk_menu_popup() is deprecated on gtk 3.22
Use gtk_menu_popup_at_pointer() if gtk is 3.22 or upper.
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rw-r--r-- | src/camorama-window.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/camorama-window.c b/src/camorama-window.c index f5b1c76..5f752a8 100644 --- a/src/camorama-window.c +++ b/src/camorama-window.c @@ -84,6 +84,7 @@ static void delete_filter_clicked(GtkTreeSelection *sel, g_list_free_full(paths, (GDestroyNotify) gtk_tree_path_free); } +#if !(GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 22) static void menu_position_func(GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer user_data) { @@ -96,6 +97,7 @@ static void menu_position_func(GtkMenu *menu, gint *x, gint *y, // find the selected row and open the popup there } } +#endif static void show_popup(cam_t *cam, GtkTreeView *treeview, GdkEventButton *ev) @@ -142,11 +144,15 @@ static void show_popup(cam_t *cam, GtkTreeView *treeview, g_free(filters); gtk_widget_show_all(GTK_WIDGET(menu)); +#if GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 22 + gtk_menu_popup_at_pointer(menu, NULL); +#else gtk_menu_popup(menu, NULL, NULL, menu_position_func, ev, ev ? ev->button : 0, ev ? ev->time : gtk_get_current_event_time()); +#endif } static void treeview_popup_menu_cb(cam_t *cam, GtkTreeView *treeview) |