diff options
-rw-r--r-- | configure.ac | 16 | ||||
-rw-r--r-- | mate-applet/topmenu-mate-panel-applet.c | 23 |
2 files changed, 35 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index a245bbb..b7cc02f 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) -AC_INIT(libtopmenu-gtk, 1.0, javier@javispedro.com) +AC_INIT(libtopmenu-gtk, 0.3, dev.bugs@javispedro.com) AC_CONFIG_SRCDIR([libtopmenu-server/topmenu-server.h]) AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE([foreign]) @@ -69,8 +69,19 @@ AS_IF([test "x$with_gtk" = x3], [if test "x$with_wnck" = xwnck3; then AC_MSG_FAILURE([--with-wnck=wnck3 was given, but test for libwnck-3.0 failed]) fi] + )]) + AS_IF([test "x$enable_mate_applet" != xno], + [PKG_CHECK_MODULES([MATEPANELAPPLET], [libmatepanelapplet-4.0 >= 1.12], + [ + AC_DEFINE([HAVE_MATEPANELAPPLET], [1], [Define if you have libmatepanelapplet]) + enable_mate_applet=yes + ], + [if test "x$enable_mate_applet" = xyes; then + AC_MSG_FAILURE([--enable-mate-applet was given, but test for libmatepanelapplet failed]) + fi] )])], + [AS_IF([test "x$with_wnck" = xwnck1 -o "x$with_wnck" = xcheck], [PKG_CHECK_MODULES([WNCK1], [libwnck-1.0], [ @@ -91,7 +102,6 @@ AS_IF([test "x$with_gtk" = x3], AC_MSG_FAILURE([--with-wnck=matewnck was given, but test for libmatewnck failed]) fi] )]) - AS_IF([test "x$enable_mate_applet" != xno], [PKG_CHECK_MODULES([MATEPANELAPPLET], [libmatepanelapplet-4.0], [ @@ -102,7 +112,6 @@ AS_IF([test "x$with_gtk" = x3], AC_MSG_FAILURE([--enable-mate-applet was given, but test for libmatepanelapplet failed]) fi] )]) - AS_IF([test "x$enable_xfce_applet" != xno], [PKG_CHECK_MODULES([XFCEPANELAPPLET], [libxfce4panel-1.0 >= 4.8], [ @@ -113,7 +122,6 @@ AS_IF([test "x$with_gtk" = x3], AC_MSG_FAILURE([--enable-xfce-applet was given, but test for libxfce4panel failed]) fi] )]) - AS_IF([test "x$enable_lxpanel_plugin" != xno], [PKG_CHECK_MODULES([LXPANELPLUGIN], [lxpanel >= 0.8.0 libfm >= 1.2.3], [ diff --git a/mate-applet/topmenu-mate-panel-applet.c b/mate-applet/topmenu-mate-panel-applet.c index eb133bb..fbbad59 100644 --- a/mate-applet/topmenu-mate-panel-applet.c +++ b/mate-applet/topmenu-mate-panel-applet.c @@ -60,6 +60,23 @@ static void topmenu_mate_panel_applet_size_allocate(GtkWidget *widget, GtkAlloca GTK_WIDGET_CLASS(topmenu_mate_panel_applet_parent_class)->size_allocate(widget, allocation); } +#if GTK_MAJOR_VERSION == 3 +static void topmenu_mate_panel_get_preferred_width(GtkWidget *widget, gint *minimal_width, gint *natural_width) +{ + TopMenuMatePanelApplet *self = TOPMENU_MATE_PANEL_APPLET(widget); + if (self->menu_widget) { + gtk_widget_get_preferred_width(GTK_WIDGET(self->menu_widget), minimal_width, natural_width); + } +} + +static void topmenu_mate_panel_get_preferred_height(GtkWidget *widget, gint *minimal_height, gint *natural_height) +{ + TopMenuMatePanelApplet *self = TOPMENU_MATE_PANEL_APPLET(widget); + if (self->menu_widget) { + gtk_widget_get_preferred_height(GTK_WIDGET(self->menu_widget), minimal_height, natural_height); + } +} +#elif GTK_MAJOR_VERSION == 2 static void topmenu_mate_panel_applet_size_request(GtkWidget *widget, GtkRequisition *requisition) { TopMenuMatePanelApplet *self = TOPMENU_MATE_PANEL_APPLET(widget); @@ -67,12 +84,18 @@ static void topmenu_mate_panel_applet_size_request(GtkWidget *widget, GtkRequisi gtk_widget_size_request(GTK_WIDGET(self->menu_widget), requisition); } } +#endif static void topmenu_mate_panel_applet_class_init(TopMenuMatePanelAppletClass *klass) { GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); widget_class->size_allocate = topmenu_mate_panel_applet_size_allocate; +#if GTK_MAJOR_VERSION == 3 + widget_class->get_preferred_width = topmenu_mate_panel_get_preferred_width; + widget_class->get_preferred_height = topmenu_mate_panel_get_preferred_height; +#elif GTK_MAJOR_VERSION == 2 widget_class->size_request = topmenu_mate_panel_applet_size_request; +#endif } static void topmenu_mate_panel_applet_init(TopMenuMatePanelApplet *self) |