[frogr] Don't use deprecated gtk_menu_popup() if GTK+ >= 3.22
- From: Mario Sanchez Prada <msanchez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [frogr] Don't use deprecated gtk_menu_popup() if GTK+ >= 3.22
- Date: Mon, 1 May 2017 01:11:06 +0000 (UTC)
commit 3ddbf7125abacf3d032147d6b5d6e9552d002300
Author: Mario Sanchez Prada <msanchez gnome org>
Date: Mon May 1 02:10:05 2017 +0100
Don't use deprecated gtk_menu_popup() if GTK+ >= 3.22
src/frogr-main-view.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/frogr-main-view.c b/src/frogr-main-view.c
index 1ef6b96..c39f848 100644
--- a/src/frogr-main-view.c
+++ b/src/frogr-main-view.c
@@ -1096,8 +1096,17 @@ _on_icon_view_key_press_event (GtkWidget *widget,
&& self->n_selected_pictures > 0)
{
GtkMenu *menu = GTK_MENU (self->pictures_ctxt_menu);
+
+#if GTK_CHECK_VERSION (3, 22, 0)
+ gtk_menu_popup_at_widget (menu,
+ widget,
+ GDK_GRAVITY_CENTER,
+ GDK_GRAVITY_CENTER,
+ (GdkEvent *) event);
+#else
gtk_menu_popup (menu, NULL, NULL, NULL, NULL,
0, gtk_get_current_event_time ());
+#endif
}
return FALSE;
@@ -1272,10 +1281,15 @@ _on_icon_view_button_press_event (GtkWidget *widget,
else if (!is_primary_btn && is_single_click)
{
/* Show contextual menu */
+#if GTK_CHECK_VERSION (3, 22, 0)
+ gtk_menu_popup_at_pointer (GTK_MENU (self->pictures_ctxt_menu),
+ (GdkEvent *) event);
+#else
gtk_menu_popup (GTK_MENU (self->pictures_ctxt_menu),
NULL, NULL, NULL, NULL,
event->button,
gtk_get_current_event_time ());
+#endif
}
/* Free */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]