[Xfce4-commits] [panel-plugins/xfce4-mount-plugin] 01/02: Support Gtk < 3.22 and new release 1.1.2
noreply at xfce.org
noreply at xfce.org
Tue Feb 21 20:40:17 CET 2017
This is an automated email from the git hooks/post-receive script.
timystery pushed a commit to branch master
in repository panel-plugins/xfce4-mount-plugin.
commit 995ad89705114cbec535576dcbc76a30f86877f3
Author: Fabian <timystery at arcor.de>
Date: Tue Feb 21 20:06:08 2017 +0100
Support Gtk < 3.22 and new release 1.1.2
---
configure.ac.in | 4 ++--
panel-plugin/mount-plugin.c | 31 ++++++++++++++++++++++---------
2 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/configure.ac.in b/configure.ac.in
index d4097d7..6d9bf97 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -3,14 +3,14 @@ dnl
dnl xfce4-mount-plugin - Mount plugin for xfce4-panel
dnl
dnl 2003-2004 Benedikt Meurer <benny at xfce.org>
-dnl 2005-2016 Fabian Nowak <timystery at arcor.de>
+dnl 2005-2017 Fabian Nowak <timystery at arcor.de>
dnl 2012 Landry Breuil <landry at xfce.org>
dnl
dnl for Xfce4-panel 4.12 and higher only!
m4_define([mount_version_major], [1])
m4_define([mount_version_minor], [1])
-m4_define([mount_version_micro], [1])
+m4_define([mount_version_micro], [2])
m4_define([mount_version_tag], []) # Leave empty only for releases, but use 'git' in most cases
m4_define([mount_version_build], [@REVISION@])
m4_define([mount_version], [mount_version_major().mount_version_minor().mount_version_micro()ifelse(mount_version_tag(), [], [], [mount_version_tag()-mount_version_build()])])
diff --git a/panel-plugin/mount-plugin.c b/panel-plugin/mount-plugin.c
index c4a5ef8..a74c1cb 100644
--- a/panel-plugin/mount-plugin.c
+++ b/panel-plugin/mount-plugin.c
@@ -1,8 +1,8 @@
/* mount-plugin.c */
/*
-Copyright (C) 2005 Jean-Baptiste jb_dul at yahoo.com
-Copyright (C) 2005-2008 Fabian Nowak timystery at arcor.de.
+Copyright (C) 2005 Jean-Baptiste <jb_dul at yahoo.com>
+Copyright (C) 2005-2017 Fabian Nowak <timystery at arcor.de>.
Copyright (C) 2012 Landry Breuil <landry at xfce.org>
This program is free software; you can redistribute it and/or
@@ -353,17 +353,30 @@ mounter_refresh (t_mounter * mt)
static gboolean
on_button_press (GtkWidget *widget, GdkEventButton *eventButton, t_mounter *mounter)
{
+ gboolean result = FALSE;
+#if GTK_CHECK_VERSION (3,22,0)
+ GdkEvent event;
+#endif
TRACE ("enters on_button_press");
- if (mounter != NULL && eventButton->button == 1) /* left click only */
+ if (eventButton != NULL)
{
- GdkEvent event;
- 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);
- return TRUE;
+ if (mounter != NULL && eventButton->button == 1) /* left click only */
+ {
+ mounter_refresh (mounter); /* refreshs infos regarding mounts data */
+#if GTK_CHECK_VERSION (3,22,0)
+ event.button = *eventButton;
+ gtk_menu_popup_at_widget (GTK_MENU(mounter->menu), mounter->button, GDK_GRAVITY_CENTER, GDK_GRAVITY_CENTER, &event);
+#else
+ gtk_menu_popup (GTK_MENU(mounter->menu), NULL, NULL,
+ xfce_panel_plugin_position_menu, mounter->plugin,
+ 0, eventButton->time);
+#endif
+ result = TRUE;
+ }
}
TRACE ("leaves on_button_press");
- return FALSE ;
+
+ return result ;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list