summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexei Sorokin <[email protected]>2017-04-26 21:15:14 +0200
committerAlexei Sorokin <[email protected]>2017-04-26 21:15:14 +0200
commitc8470f3d06c21985e41340dc119cc3dd65b30962 (patch)
treeb282e25b1c2ff5a09c8a672497a4170afe4e154a
parentc308ea07559e7f86f5dd2073d4af8660afb37d72 (diff)
downloadeom-c8470f3d06c21985e41340dc119cc3dd65b30962.tar.bz2
eom-c8470f3d06c21985e41340dc119cc3dd65b30962.tar.xz
EomScrollView: Replace deprecated gtk_menu_popup function
-rw-r--r--src/eom-scroll-view.c33
1 files changed, 11 insertions, 22 deletions
diff --git a/src/eom-scroll-view.c b/src/eom-scroll-view.c
index 7099c6b..adb6d26 100644
--- a/src/eom-scroll-view.c
+++ b/src/eom-scroll-view.c
@@ -2133,34 +2133,23 @@ eom_scroll_view_new (void)
return widget;
}
-static void
-eom_scroll_view_popup_menu (EomScrollView *view, GdkEventButton *event)
-{
- GtkWidget *popup;
- int button, event_time;
-
- popup = view->priv->menu;
-
- if (event) {
- button = event->button;
- event_time = event->time;
- } else {
- button = 0;
- event_time = gtk_get_current_event_time ();
- }
-
- gtk_menu_popup (GTK_MENU (popup), NULL, NULL, NULL, NULL,
- button, event_time);
-}
-
static gboolean
-view_on_button_press_event_cb (GtkWidget *view, GdkEventButton *event,
+view_on_button_press_event_cb (GtkWidget *widget, GdkEventButton *event,
gpointer user_data)
{
+ EomScrollView *view = EOM_SCROLL_VIEW (widget);
+
/* Ignore double-clicks and triple-clicks */
if (event->button == 3 && event->type == GDK_BUTTON_PRESS)
{
- eom_scroll_view_popup_menu (EOM_SCROLL_VIEW (view), event);
+#if GTK_CHECK_VERSION (3, 22, 0)
+ gtk_menu_popup_at_pointer (GTK_MENU (view->priv->menu),
+ (const GdkEvent*) event);
+#else
+ gtk_menu_popup (GTK_MENU (view->priv->menu),
+ NULL, NULL, NULL, NULL,
+ event->button, event->time);
+#endif
return TRUE;
}