diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-02-07 09:48:27 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-02-07 09:48:27 +0800 |
commit | 0cc56c014f68be35e3ac12ccc500ee3528cceea0 (patch) | |
tree | e2498f11066bf83247332cb05c40b4ff4fb76e83 /widgets/table/e-table.c | |
parent | 31e449ebed6a136e643ec3bf4c0d9f1b3fc87897 (diff) | |
download | gsoc2013-evolution-0cc56c014f68be35e3ac12ccc500ee3528cceea0.tar.gz gsoc2013-evolution-0cc56c014f68be35e3ac12ccc500ee3528cceea0.tar.zst gsoc2013-evolution-0cc56c014f68be35e3ac12ccc500ee3528cceea0.zip |
Bug 602416 - Changing shell views emits many runtime warnings
Diffstat (limited to 'widgets/table/e-table.c')
-rw-r--r-- | widgets/table/e-table.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index 14b3707464..8d2f195fa6 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -734,6 +734,8 @@ table_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, if (e_table->reflow_idle_id) g_source_remove(e_table->reflow_idle_id); table_canvas_reflow_idle(e_table); + + e_table->size_allocated = TRUE; } static void @@ -992,16 +994,24 @@ changed_idle (gpointer data) { ETable *et = E_TABLE (data); - if (et->need_rebuild) { + /* Wait until we have a valid size allocation. */ + if (et->need_rebuild && et->size_allocated) { + GtkWidget *widget; + GtkAllocation allocation; + if (et->group) gtk_object_destroy (GTK_OBJECT (et->group)); et_build_groups(et); - g_object_set (et->canvas_vbox, - "width", (gdouble) GTK_WIDGET (et->table_canvas)->allocation.width, - NULL); - if (GTK_WIDGET_REALIZED(et->table_canvas)) - table_canvas_size_allocate (GTK_WIDGET(et->table_canvas), >K_WIDGET(et->table_canvas)->allocation, et); + widget = GTK_WIDGET (et->table_canvas); + gtk_widget_get_allocation (widget, &allocation); + + g_object_set ( + et->canvas_vbox, + "width", (gdouble) allocation.width, + NULL); + + table_canvas_size_allocate (widget, &allocation, et); } et->need_rebuild = 0; |