Index: lxpanel-0.5.8/src/plugins/menu.c =================================================================== --- lxpanel-0.5.8.orig/src/plugins/menu.c 2011-10-05 23:55:47.000000000 +0200 +++ lxpanel-0.5.8/src/plugins/menu.c 2011-10-05 23:55:49.000000000 +0200 @@ -131,8 +131,8 @@ int ox, oy, w, h; Plugin *p; #if GTK_CHECK_VERSION(2,18,0) - GtkAllocation allocation; - gtk_widget_set_allocation(widget, &allocation); + GtkAllocation *allocation = g_new0 (GtkAllocation, 1); + gtk_widget_get_allocation(GTK_WIDGET(widget), allocation); #endif ENTER; p = g_object_get_data(G_OBJECT(widget), "plugin"); @@ -155,20 +155,20 @@ *x = ox; if (*x + w > gdk_screen_width()) #if GTK_CHECK_VERSION(2,18,0) - *x = ox + allocation.width - w; + *x = ox + allocation->width - w; #else *x = ox + widget->allocation.width - w; #endif *y = oy - h; if (*y < 0) #if GTK_CHECK_VERSION(2,18,0) - *y = oy + allocation.height; + *y = oy + allocation->height; #else *y = oy + widget->allocation.height; #endif } else { #if GTK_CHECK_VERSION(2,18,0) - *x = ox + allocation.width; + *x = ox + allocation->width; #else *x = ox + widget->allocation.width; #endif @@ -177,19 +177,22 @@ *y = oy; if (*y + h > gdk_screen_height()) #if GTK_CHECK_VERSION(2,18,0) - *y = oy + allocation.height - h; + *y = oy + allocation->height - h; #else *y = oy + widget->allocation.height - h; #endif } DBG("widget: x,y=%d,%d w,h=%d,%d\n", ox, oy, #if GTK_CHECK_VERSION(2,18,0) - allocation.width, allocation.height ); + allocation->width, allocation->height ); #else widget->allocation.width, widget->allocation.height ); #endif DBG("w-h %d %d\n", w, h); *push_in = TRUE; +#if GTK_CHECK_VERSION(2,18,0) + g_free (allocation); +#endif RET(); } @@ -634,8 +637,8 @@ { ENTER; #if GTK_CHECK_VERSION(2,18,0) - GtkAllocation allocation; - gtk_widget_get_allocation(widget, &allocation); + GtkAllocation *allocation = g_new0 (GtkAllocation, 1); + gtk_widget_get_allocation(GTK_WIDGET(widget), allocation); #endif /* Standard right-click handling. */ @@ -644,14 +647,17 @@ if ((event->type == GDK_BUTTON_PRESS) #if GTK_CHECK_VERSION(2,18,0) - && (event->x >=0 && event->x < allocation.width) - && (event->y >=0 && event->y < allocation.height)) { + && (event->x >=0 && event->x < allocation->width) + && (event->y >=0 && event->y < allocation->height)) { #else && (event->x >=0 && event->x < widget->allocation.width) && (event->y >=0 && event->y < widget->allocation.height)) { #endif show_menu( widget, plugin, event->button, event->time ); } +#if GTK_CHECK_VERSION(2,18,0) + g_free (allocation); +#endif RET(TRUE); } Index: lxpanel-0.5.8/src/plugins/pager.c =================================================================== --- lxpanel-0.5.8.orig/src/plugins/pager.c 2011-10-05 23:55:47.000000000 +0200 +++ lxpanel-0.5.8/src/plugins/pager.c 2011-10-05 23:56:29.000000000 +0200 @@ -271,10 +271,10 @@ { /* Allocate pixmap and statistics buffer without border pixels. */ #if GTK_CHECK_VERSION(2,18,0) - GtkAllocation allocation; - gtk_widget_get_allocation(widget, &allocation); - int new_pixmap_width = allocation.width; - int new_pixmap_height = allocation.height; + GtkAllocation *allocation = g_new0 (GtkAllocation, 1); + gtk_widget_get_allocation(GTK_WIDGET(widget), allocation); + int new_pixmap_width = allocation->width; + int new_pixmap_height = allocation->height; #else int new_pixmap_width = widget->allocation.width; int new_pixmap_height = widget->allocation.height; @@ -292,8 +292,8 @@ /* Compute the horizontal and vertical scale factors, and mark the desktop for redraw. */ #if GTK_CHECK_VERSION(2,18,0) - d->scale_y = (gfloat) allocation.height / (gfloat) gdk_screen_height(); - d->scale_x = (gfloat) allocation.width / (gfloat) gdk_screen_width(); + d->scale_y = (gfloat) allocation->height / (gfloat) gdk_screen_height(); + d->scale_x = (gfloat) allocation->width / (gfloat) gdk_screen_width(); #else d->scale_y = (gfloat) allocation->height / (gfloat) gdk_screen_height(); d->scale_x = (gfloat) allocation->width / (gfloat) gdk_screen_width(); @@ -305,6 +305,9 @@ gtk_widget_set_size_request(widget, (d->pg->plugin->panel->icon_size - BORDER_WIDTH * 2) * d->pg->aspect_ratio, d->pg->plugin->panel->icon_size - BORDER_WIDTH * 2); +#if GTK_CHECK_VERSION(2,18,0) + g_free (allocation); +#endif return FALSE; } @@ -326,8 +329,8 @@ { GtkWidget * widget = GTK_WIDGET(d->da); #if GTK_CHECK_VERSION(2,18,0) - GtkAllocation allocation; - gtk_widget_get_allocation(widget, &allocation); + GtkAllocation *allocation = g_new0 (GtkAllocation, 1); + gtk_widget_get_allocation(GTK_WIDGET(widget), allocation); #endif gdk_draw_rectangle( d->pixmap, @@ -336,7 +339,8 @@ : style->dark_gc[GTK_STATE_NORMAL]), TRUE, #if GTK_CHECK_VERSION(2,18,0) - 0, 0, allocation.width, allocation.height); + 0, 0, allocation->width, allocation->height); + g_free (allocation); #else 0, 0, widget->allocation.width, widget->allocation.height); #endif