1 commit 56a244f2aa3c474b2506847ba9a2f5a21cb8efc2
2 Author: Julien Lavergne <julien.lavergne@gmail.com>
3 Date: Tue Jul 26 01:21:04 2011 +0200
5 Fix GtkAllocation to fix empty lxlauncher
7 diff --git a/src/exo-wrap-table.c b/src/exo-wrap-table.c
8 index c691434..f48322f 100644
9 --- a/src/exo-wrap-table.c
10 +++ b/src/exo-wrap-table.c
11 @@ -326,14 +326,14 @@ exo_wrap_table_size_request (GtkWidget *widget,
12 if (G_LIKELY (num_children > 0))
14 #if GTK_CHECK_VERSION(2,18,0)
15 - GtkAllocation allocation;
16 - gtk_widget_set_allocation(widget, &allocation);
17 - num_cols = exo_wrap_table_get_num_fitting (allocation.width
18 + GtkAllocation *allocation = g_new0 (GtkAllocation, 1);
19 + gtk_widget_get_allocation(GTK_WIDGET(widget), allocation);
20 + num_cols = exo_wrap_table_get_num_fitting (allocation->width
21 - gtk_container_get_border_width(GTK_CONTAINER (widget)) * 2,
22 table->priv->col_spacing, max_width);
24 num_cols = exo_wrap_table_get_num_fitting (widget->allocation.width
25 - - gtk_container_get_border_width(GTK_CONTAINER (widget)) * 2,
26 + - GTK_CONTAINER (widget)->border_width * 2,
27 table->priv->col_spacing, max_width);
29 num_rows = num_children / num_cols;
30 @@ -345,7 +345,12 @@ exo_wrap_table_size_request (GtkWidget *widget,
31 requisition->width = -1;
32 requisition->height = (num_rows * max_height)
33 + (num_rows - 1) * table->priv->col_spacing
34 +#if GTK_CHECK_VERSION(2,18,0)
35 + gtk_container_get_border_width(GTK_CONTAINER (widget)) * 2;
36 + g_free (allocation);
38 + + GTK_CONTAINER (widget)->border_width * 2;
43 @@ -479,8 +484,8 @@ exo_wrap_table_layout (ExoWrapTable *table)
46 #if GTK_CHECK_VERSION(2,18,0)
47 - GtkAllocation allocation;
48 - gtk_widget_set_allocation(GTK_WIDGET(table), &allocation);
49 + GtkAllocation *allocation = g_new0 (GtkAllocation, 1);
50 + gtk_widget_get_allocation(GTK_WIDGET(table), allocation);
53 /* determine the number of visible children and the max size */
54 @@ -490,7 +495,7 @@ exo_wrap_table_layout (ExoWrapTable *table)
56 /* determine the number of columns */
57 #if GTK_CHECK_VERSION(2,18,0)
58 - num_cols = exo_wrap_table_get_num_fitting (allocation.width
59 + num_cols = exo_wrap_table_get_num_fitting (allocation->width
60 - gtk_container_get_border_width(GTK_CONTAINER (table)) * 2,
61 table->priv->col_spacing, max_width);
63 @@ -509,8 +514,8 @@ exo_wrap_table_layout (ExoWrapTable *table)
65 /* determine the horizontal bounds */
66 #if GTK_CHECK_VERSION(2,18,0)
67 - x0 = allocation.x + gtk_container_get_border_width(GTK_CONTAINER (table));
68 - x1 = x0 + allocation.width - gtk_container_get_border_width(GTK_CONTAINER (table));
69 + x0 = allocation->x + gtk_container_get_border_width(GTK_CONTAINER (table));
70 + x1 = x0 + allocation->width - gtk_container_get_border_width(GTK_CONTAINER (table));
72 x0 = GTK_WIDGET (table)->allocation.x + GTK_CONTAINER (table)->border_width;
73 x1 = x0 + GTK_WIDGET (table)->allocation.width - GTK_CONTAINER (table)->border_width;
74 @@ -519,7 +524,8 @@ exo_wrap_table_layout (ExoWrapTable *table)
75 /* initialize the position */
77 #if GTK_CHECK_VERSION(2,18,0)
78 - y = allocation.y + gtk_container_get_border_width(GTK_CONTAINER (table));
79 + y = allocation->y + gtk_container_get_border_width(GTK_CONTAINER (table));
80 + g_free (allocation);
82 y = GTK_WIDGET (table)->allocation.y + GTK_CONTAINER (table)->border_width;