Browse Source

Fix launcher icon load after xfsettingsd crash.

Also replace deprecated gtk_type_class() function.
upstream/xfce4-panel-4.10.1
Nick Schermer 13 years ago
parent
commit
8a8bb04d11
  1. 38
      libxfce4panel/xfce-hvbox.c
  2. 4
      plugins/launcher/launcher.c

38
libxfce4panel/xfce-hvbox.c

@ -30,13 +30,13 @@
static void xfce_hvbox_class_init (XfceHVBoxClass *klass);
static void xfce_hvbox_init (XfceHVBox *hvbox);
static GtkWidgetClass *xfce_hvbox_get_class (XfceHVBox *hvbox);
static void xfce_hvbox_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void xfce_hvbox_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void xfce_hvbox_class_init (XfceHVBoxClass *klass);
static void xfce_hvbox_init (XfceHVBox *hvbox);
static gpointer xfce_hvbox_get_class (XfceHVBox *hvbox);
static void xfce_hvbox_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void xfce_hvbox_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
@ -65,18 +65,22 @@ xfce_hvbox_init (XfceHVBox *hvbox)
static GtkWidgetClass *
static gpointer
xfce_hvbox_get_class (XfceHVBox *hvbox)
{
GType type;
GType type;
gpointer klass;
if (hvbox->orientation == GTK_ORIENTATION_HORIZONTAL)
type = GTK_TYPE_HBOX;
else
type = GTK_TYPE_VBOX;
/* return the widget class of the type */
return GTK_WIDGET_CLASS (gtk_type_class (type));
/* peek the class, this only works if the class already exists */
klass = g_type_class_peek (type);
/* return the type or create the class */
return klass ? klass : g_type_class_ref (type);
}
@ -85,12 +89,13 @@ static void
xfce_hvbox_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkWidgetClass *klass;
gpointer klass;
/* get the widget class */
klass = xfce_hvbox_get_class (XFCE_HVBOX (widget));
(*klass->size_request) (widget, requisition);
/* request the size */
(*GTK_WIDGET_CLASS (klass)->size_request) (widget, requisition);
}
@ -99,12 +104,13 @@ static void
xfce_hvbox_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GtkWidgetClass *klass;
gpointer klass;
/* get the widget class */
klass = xfce_hvbox_get_class (XFCE_HVBOX (widget));
(*klass->size_allocate) (widget, allocation);
/* allocate the size */
(*GTK_WIDGET_CLASS (klass)->size_allocate) (widget, allocation);
}

4
plugins/launcher/launcher.c

@ -109,10 +109,6 @@ launcher_utility_icon_theme_changed (GSignalInvocationHint *ihint,
const GValue *param_values,
LauncherPlugin *launcher)
{
/* only update if we already have an image, this fails when the signal is connected */
if (G_LIKELY (gtk_image_get_storage_type (GTK_IMAGE (launcher->image)) == GTK_IMAGE_EMPTY))
return TRUE;
/* update the button icon */
launcher_icon_button_set_icon (launcher);

Loading…
Cancel
Save