[Xfce4-commits] r29737 - in xfce4-panel/trunk: . libxfce4panel
Nick Schermer
nick at xfce.org
Thu Apr 9 20:33:21 CEST 2009
Author: nick
Date: 2009-04-09 18:33:21 +0000 (Thu, 09 Apr 2009)
New Revision: 29737
Modified:
xfce4-panel/trunk/NEWS
xfce4-panel/trunk/libxfce4panel/xfce-hvbox.c
Log:
Fix xfce-hvbox not working with gtk 2.16 (bug #5166).
Patch by Enrico Troger.
Modified: xfce4-panel/trunk/NEWS
===================================================================
--- xfce4-panel/trunk/NEWS 2009-04-09 14:43:34 UTC (rev 29736)
+++ xfce4-panel/trunk/NEWS 2009-04-09 18:33:21 UTC (rev 29737)
@@ -4,6 +4,7 @@
- Fix compilation with -Wl,--as-needed (bug #5103).
- Don't crash when the quit action button is pressed (bug #5118).
- Properly set the systray orientation property (bug #5149).
+- Fix xfce-hvbox not working with gtk 2.16 (bug #5166).
4.6.0
Modified: xfce4-panel/trunk/libxfce4panel/xfce-hvbox.c
===================================================================
--- xfce4-panel/trunk/libxfce4panel/xfce-hvbox.c 2009-04-09 14:43:34 UTC (rev 29736)
+++ xfce4-panel/trunk/libxfce4panel/xfce-hvbox.c 2009-04-09 18:33:21 UTC (rev 29737)
@@ -25,8 +25,7 @@
#endif
#include <gdk/gdk.h>
-#include <gtk/gtkhbox.h>
-#include <gtk/gtkvbox.h>
+#include <gtk/gtk.h>
#include <libxfce4panel/xfce-panel-macros.h>
#include <libxfce4panel/xfce-hvbox.h>
@@ -36,13 +35,14 @@
/* prototypes */
static void xfce_hvbox_class_init (XfceHVBoxClass *klass);
+#if ! GTK_CHECK_VERSION (2, 16, 0)
static void xfce_hvbox_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void xfce_hvbox_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
+#endif
-
GtkType
xfce_hvbox_get_type (void)
{
@@ -70,12 +70,15 @@
widget_class = (GtkWidgetClass *) klass;
+#if ! GTK_CHECK_VERSION (2, 16, 0)
widget_class->size_request = xfce_hvbox_size_request;
widget_class->size_allocate = xfce_hvbox_size_allocate;
+#endif
}
+#if ! GTK_CHECK_VERSION (2, 16, 0)
static gpointer
xfce_hvbox_get_class (XfceHVBox *hvbox)
{
@@ -123,6 +126,7 @@
/* allocate the size */
(*GTK_WIDGET_CLASS (klass)->size_allocate) (widget, allocation);
}
+#endif
@@ -148,6 +152,9 @@
"spacing", spacing,
NULL);
+#if GTK_CHECK_VERSION (2, 16, 0)
+ gtk_orientable_set_orientation (GTK_ORIENTABLE (box), orientation);
+#endif
XFCE_HVBOX (box)->orientation = orientation;
return box;
@@ -171,9 +178,14 @@
if (G_UNLIKELY (hvbox->orientation == orientation))
return;
+ /* set the orientation also for GTK 2.16 just in case anyone reads this field directly */
hvbox->orientation = orientation;
+#if GTK_CHECK_VERSION (2, 16, 0)
+ gtk_orientable_set_orientation (GTK_ORIENTABLE (hvbox), orientation);
+#else
gtk_widget_queue_resize (GTK_WIDGET (hvbox));
+#endif
}
More information about the Xfce4-commits
mailing list