From eb5dc08dc91a593357a6c1b1db98fac8cdb1662e Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Mon, 1 May 2000 04:01:05 +0000 Subject: Made this more reentrant. 2000-04-30 Christopher James Lahey * e-table-header-item.c: Made this more reentrant. * e-table-sorted-variable.c, e-table-sorted-variable.h: Does a proper resort when the sorting info changes. * e-table.c, e-table.h: Made it so that ETable doesn't destroy and recreate the entire table when sorting info changes. svn path=/trunk/; revision=2704 --- widgets/table/e-table-header-item.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'widgets/table/e-table-header-item.c') diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c index 65d0d3166e..f916ce447e 100644 --- a/widgets/table/e-table-header-item.c +++ b/widgets/table/e-table-header-item.c @@ -953,6 +953,7 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) GnomeCanvas *canvas = item->canvas; const gboolean resizing = ETHI_RESIZING (ethi); int x, y, start, col; + int was_maybe_drag = 0; switch (e->type){ case GDK_ENTER_NOTIFY: @@ -1042,11 +1043,15 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) case GDK_BUTTON_RELEASE: { gboolean needs_ungrab = FALSE; + + was_maybe_drag = ethi->maybe_drag; + + ethi->maybe_drag = FALSE; if (ethi->resize_col != -1){ needs_ungrab = (ethi->resize_guide != NULL); ethi_end_resize (ethi, ethi->resize_width); - } else if (ethi->maybe_drag && ethi->sort_info) { + } else if (was_maybe_drag && ethi->sort_info) { ETableCol *col; int model_col; int length; @@ -1090,10 +1095,10 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) e_table_sort_info_sorting_set_nth(ethi->sort_info, length - 1, column); } } + if (needs_ungrab) gnome_canvas_item_ungrab (item, e->button.time); - ethi->maybe_drag = FALSE; break; } -- cgit