From d8264dcae3f18842b232aff1f7511759632864d7 Mon Sep 17 00:00:00 2001 From: poma Date: Tue, 21 Feb 2017 10:33:44 +0100 Subject: [PATCH] Disperse on_button_press() amongst GTK+ 3 versions - adds support for lower than 3.22. --- panel-plugin/mount-plugin.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/panel-plugin/mount-plugin.c b/panel-plugin/mount-plugin.c index c4a5ef8..a708e1c 100644 --- a/panel-plugin/mount-plugin.c +++ b/panel-plugin/mount-plugin.c @@ -351,6 +351,7 @@ mounter_refresh (t_mounter * mt) static gboolean +#if GTK_CHECK_VERSION (3,22,0) on_button_press (GtkWidget *widget, GdkEventButton *eventButton, t_mounter *mounter) { TRACE ("enters on_button_press"); @@ -360,6 +361,18 @@ on_button_press (GtkWidget *widget, GdkEventButton *eventButton, t_mounter *moun event.button = *eventButton; mounter_refresh (mounter); /* refreshs infos regarding mounts data */ gtk_menu_popup_at_widget (GTK_MENU(mounter->menu), mounter->button, GDK_GRAVITY_CENTER, GDK_GRAVITY_CENTER, &event); +#else +on_button_press (GtkWidget *widget, GdkEventButton *event, t_mounter *mounter) +{ + TRACE ("enters on_button_press"); + if (mounter != NULL && event->button == 1) /* left click only */ + { + + mounter_refresh (mounter); /* refreshs infos regarding mounts data */ + gtk_menu_popup (GTK_MENU(mounter->menu), NULL, NULL, + xfce_panel_plugin_position_menu, mounter->plugin, + 0, event->time); +#endif return TRUE; } TRACE ("leaves on_button_press"); -- 2.7.4