Browse Source

Fix xfce-hvbox not working with gtk 2.16 (bug #5166).

Patch by Enrico Troger.


(Old svn revision: 29737)
upstream/xfce4-panel-4.10.1
Nick Schermer 13 years ago
parent
commit
135d75abf4
  1. 1
      NEWS
  2. 18
      libxfce4panel/xfce-hvbox.c

1
NEWS

@ -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

18
libxfce4panel/xfce-hvbox.c

@ -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,11 +35,12 @@
/* 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
@ -70,12 +70,15 @@ xfce_hvbox_class_init (XfceHVBoxClass *klass)
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 @@ xfce_hvbox_size_allocate (GtkWidget *widget,
/* allocate the size */
(*GTK_WIDGET_CLASS (klass)->size_allocate) (widget, allocation);
}
#endif
@ -148,6 +152,9 @@ xfce_hvbox_new (GtkOrientation orientation,
"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 @@ xfce_hvbox_set_orientation (XfceHVBox *hvbox,
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
}

Loading…
Cancel
Save