From a5b3699d67ab65cfe5bd0139400324bee33019d9 Mon Sep 17 00:00:00 2001 From: Andrzej Date: Tue, 3 Apr 2012 21:13:09 +0900 Subject: [PATCH] xfce4-panel 4.9+ compatibility fix --- panel-plugin/mount-plugin.c | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-) diff --git a/panel-plugin/mount-plugin.c b/panel-plugin/mount-plugin.c index 72a9325..6105555 100644 --- a/panel-plugin/mount-plugin.c +++ b/panel-plugin/mount-plugin.c @@ -24,6 +24,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #include "mount-plugin.h" +#ifdef LIBXFCE4PANEL_CHECK_VERSION +#if LIBXFCE4PANEL_CHECK_VERSION (4,9,0) +#define HAS_PANEL_49 +#endif +#endif + + static void on_message_dialog_response (GtkWidget *widget, gpointer *data) { @@ -86,7 +93,10 @@ static void mounter_set_size (XfcePanelPlugin *plugin, int size, t_mounter *mt) { /* shrink the gtk button's image to new size -*/ - gtk_widget_set_size_request (GTK_WIDGET(mt->button), size - 4, size - 4); +#ifdef HAS_PANEL_49 + size /= xfce_panel_plugin_get_nrows (plugin); +#endif + gtk_widget_set_size_request (GTK_WIDGET(mt->button), size, size); } @@ -1051,6 +1061,10 @@ mount_construct (XfcePanelPlugin *plugin) xfce_iconbutton_set_pixbuf (XFCE_ICONBUTTON(mounter->button), mounter->button_pb); +#ifdef HAS_PANEL_49 + xfce_panel_plugin_set_small (plugin, TRUE); +#endif + g_signal_connect (plugin, "free-data", G_CALLBACK (mounter_free), mounter); g_signal_connect (plugin, "save", G_CALLBACK (mounter_write_config), -- 1.7.5.4