diff options
Diffstat (limited to 'widgets/table/e-table-item.c')
-rw-r--r-- | widgets/table/e-table-item.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index 473901bf67..794c64dc84 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -816,6 +816,24 @@ eti_maybe_show_cursor(ETableItem *eti, int delay) eti_check_cursor_bounds (eti); } +static gboolean +eti_idle_maybe_show_cursor_cb (gpointer data) +{ + ETableItem *eti = data; + if (!GTK_OBJECT_DESTROYED (eti)) { + eti_maybe_show_cursor (eti, 0); + } + gtk_object_unref (GTK_OBJECT (eti)); + return FALSE; +} + +static void +eti_idle_maybe_show_cursor(ETableItem *eti) +{ + gtk_object_ref (GTK_OBJECT (eti)); + g_idle_add (eti_idle_maybe_show_cursor_cb, eti); +} + /* * Callback routine: invoked before the ETableModel has suffers a change */ @@ -845,7 +863,7 @@ eti_table_model_changed (ETableModel *table_model, ETableItem *eti) eti->needs_redraw = 1; gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (eti)); - eti_maybe_show_cursor(eti, 0); + eti_idle_maybe_show_cursor(eti); } static void @@ -893,6 +911,8 @@ eti_table_model_rows_inserted (ETableModel *table_model, int row, int count, ETa eti->height_cache[i] = -1; } + eti_idle_maybe_show_cursor(eti); + eti->needs_compute_height = 1; e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (eti)); eti->needs_redraw = 1; @@ -915,6 +935,8 @@ eti_table_model_rows_deleted (ETableModel *table_model, int row, int count, ETab memmove(eti->height_cache + row, eti->height_cache + row + count, (eti->rows - row) * sizeof(int)); } + eti_idle_maybe_show_cursor(eti); + eti->needs_compute_height = 1; e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (eti)); eti->needs_redraw = 1; |