From 74f2676f80412cb118b899175038107ae576052f Mon Sep 17 00:00:00 2001 From: Andrzej Date: Mon, 2 Apr 2012 03:48:58 +0900 Subject: [PATCH 1/2] Fixing build errors with exo --- configure.in.in | 2 +- panel-plugin/support.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.in.in b/configure.in.in index 9198fce..2bad53c 100644 --- a/configure.in.in +++ b/configure.in.in @@ -25,7 +25,7 @@ XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.3.90.2]) XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.3.90.2]) XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.3.90.2]) XDT_CHECK_PACKAGE([THUNAR_VFS], [thunar-vfs-1], [0.3.2]) -XDT_CHECK_PACKAGE([EXO], [exo-0.3], [0.3.1.1]) +XDT_CHECK_PACKAGE([EXO], [exo-1], [0.3.1.1]) dnl check for optional packages/versions XDT_CHECK_OPTIONAL_PACKAGE([LIBXFCE4PANEL_46], [libxfce4panel-1.0], [4.5.92], [libxfce4panel46], [Take advantage of Xfce 4.6 panel changes]) diff --git a/panel-plugin/support.c b/panel-plugin/support.c index 3546cd6..3b7a13e 100644 --- a/panel-plugin/support.c +++ b/panel-plugin/support.c @@ -53,7 +53,7 @@ places_load_file_browser(const gchar *path) if(path != NULL && *path != '\0'){ DBG("exo_url_show(%s)", path); - exo_success = exo_url_show(path, NULL, NULL); + exo_success = gtk_show_uri(NULL, path, NULL, NULL); if(!exo_success){ gchar *cmd = g_strconcat("thunar \"", path, "\"", NULL); @@ -115,7 +115,7 @@ void places_load_file(const gchar *path) { if(path != NULL && *path != '\0') - exo_url_show(path, NULL, NULL); + gtk_show_uri(NULL, path, NULL, NULL); } /** -- 1.7.5.4 From 3c8d48a8356d540c81f9d65fac5845bb9f19a4f3 Mon Sep 17 00:00:00 2001 From: Andrzej Date: Mon, 2 Apr 2012 03:49:45 +0900 Subject: [PATCH 2/2] Compatibility with panel v.4.9+ --- panel-plugin/button.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 41 insertions(+), 0 deletions(-) diff --git a/panel-plugin/button.c b/panel-plugin/button.c index 8a4a0be..d74552d 100644 --- a/panel-plugin/button.c +++ b/panel-plugin/button.c @@ -61,6 +61,12 @@ #define BOX_SPACING 4 +#ifdef LIBXFCE4PANEL_CHECK_VERSION +#if LIBXFCE4PANEL_CHECK_VERSION (4,9,0) +#define HAS_PANEL_49 +#endif +#endif + enum { PROP_0, @@ -74,8 +80,14 @@ places_button_dispose(GObject*); static void places_button_resize(PlacesButton*); +#ifdef HAS_PANEL_49 +static void +places_button_mode_changed(XfcePanelPlugin*, XfcePanelPluginMode, PlacesButton*); + +#else static void places_button_orientation_changed(XfcePanelPlugin*, GtkOrientation, PlacesButton*); +#endif static gboolean places_button_size_changed(XfcePanelPlugin*, gint size, PlacesButton*); @@ -257,8 +269,13 @@ places_button_construct(PlacesButton *self, XfcePanelPlugin *plugin) places_button_resize(self); +#ifdef HAS_PANEL_49 + g_signal_connect(G_OBJECT(plugin), "mode-changed", + G_CALLBACK(places_button_mode_changed), self); +#else g_signal_connect(G_OBJECT(plugin), "orientation-changed", G_CALLBACK(places_button_orientation_changed), self); +#endif g_signal_connect(G_OBJECT(plugin), "size-changed", G_CALLBACK(places_button_size_changed), self); @@ -422,7 +439,20 @@ places_button_resize(PlacesButton *self) button_height = 2 + 2 * ((GtkWidget*) self)->style->ythickness; /* image */ +#ifdef HAS_PANEL_49 + image_size = new_size / xfce_panel_plugin_get_nrows(self->plugin) + - MAX(button_width, button_height); + if (show_label) { + xfce_panel_plugin_set_small(self->plugin, FALSE); + gtk_label_set_angle (GTK_LABEL (self->label), + (xfce_panel_plugin_get_mode(self->plugin) == GTK_ORIENTATION_VERTICAL) ? -90 : 0); + } else { + xfce_panel_plugin_set_small(self->plugin, TRUE); + new_size /= xfce_panel_plugin_get_nrows(self->plugin); + } +#else image_size = new_size - MAX(button_width, button_height); +#endif /* TODO: could check if anything changed * (though it's hard to know if the icon theme changed) */ places_button_resize_image(self, @@ -479,6 +509,16 @@ places_button_resize(PlacesButton *self) gtk_widget_set_size_request((GtkWidget*) self, total_width, total_height); } +#ifdef HAS_PANEL_49 +static void +places_button_mode_changed(XfcePanelPlugin *plugin, XfcePanelPluginMode mode, PlacesButton *self) +{ + DBG("orientation changed"); + xfce_hvbox_set_orientation(XFCE_HVBOX(self->box), xfce_panel_plugin_get_orientation (plugin)); + places_button_resize(self); +} + +#else static void places_button_orientation_changed(XfcePanelPlugin *plugin, GtkOrientation orientation, PlacesButton *self) { @@ -486,6 +526,7 @@ places_button_orientation_changed(XfcePanelPlugin *plugin, GtkOrientation orient xfce_hvbox_set_orientation(XFCE_HVBOX(self->box), orientation); places_button_resize(self); } +#endif static gboolean places_button_size_changed(XfcePanelPlugin *plugin, gint size, PlacesButton *self) -- 1.7.5.4