diff options
author | Christopher James Lahey <clahey@ximian.com> | 2001-10-23 10:09:42 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2001-10-23 10:09:42 +0800 |
commit | da49f32d5cf46f3995233e5cda353c67368da596 (patch) | |
tree | 61709cc1bccb775931407a0104593377608f0f5c /widgets/table/e-table-item.c | |
parent | 183cd7e571a0d8fe66d3b82abafbf5041ed5b910 (diff) | |
download | gsoc2013-evolution-da49f32d5cf46f3995233e5cda353c67368da596.tar gsoc2013-evolution-da49f32d5cf46f3995233e5cda353c67368da596.tar.gz gsoc2013-evolution-da49f32d5cf46f3995233e5cda353c67368da596.tar.bz2 gsoc2013-evolution-da49f32d5cf46f3995233e5cda353c67368da596.tar.lz gsoc2013-evolution-da49f32d5cf46f3995233e5cda353c67368da596.tar.xz gsoc2013-evolution-da49f32d5cf46f3995233e5cda353c67368da596.tar.zst gsoc2013-evolution-da49f32d5cf46f3995233e5cda353c67368da596.zip |
Cancel the drag or maybe drag if you have the mouse button down when the
2001-10-22 Christopher James Lahey <clahey@ximian.com>
* e-table-item.c (eti_cancel_drag_due_to_model_change): Cancel the
drag or maybe drag if you have the mouse button down when the
pre_change signal comes in. Fixes Ximian bug #11309.
* e-table-without.c (add_row, remove_row,
e_table_without_show_all): Call e_table_model_pre_change where
appropriate here.
svn path=/trunk/; revision=13927
Diffstat (limited to 'widgets/table/e-table-item.c')
-rw-r--r-- | widgets/table/e-table-item.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index 067a5fc60b..ff8dd64292 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -4,7 +4,7 @@ * * Author: * Christopher James Lahey <clahey@ximian.com> - * Miguel de Icaza (miguel@gnu.org) + * Miguel de Icaza <miguel@gnu.org> * * Copyright 1999, 2000, 2001, Ximian, Inc. * @@ -881,12 +881,26 @@ eti_idle_maybe_show_cursor(ETableItem *eti) g_idle_add (eti_idle_maybe_show_cursor_cb, eti); } +static void +eti_cancel_drag_due_to_model_change (ETableItem *eti) +{ + if (eti->maybe_in_drag) { + eti->maybe_in_drag = FALSE; + if (!eti->maybe_did_something) + e_selection_model_do_something(E_SELECTION_MODEL (eti->selection), eti->drag_row, eti->drag_col, eti->drag_state); + } + if (eti->in_drag) { + eti->in_drag = FALSE; + } +} + /* * Callback routine: invoked before the ETableModel has suffers a change */ static void eti_table_model_pre_change (ETableModel *table_model, ETableItem *eti) { + eti_cancel_drag_due_to_model_change (eti); eti_check_cursor_bounds (eti); if (eti_editing (eti)) e_table_item_leave_edit (eti); @@ -895,6 +909,7 @@ eti_table_model_pre_change (ETableModel *table_model, ETableItem *eti) /* * Callback routine: invoked when the ETableModel has suffered a change */ + static void eti_table_model_changed (ETableModel *table_model, ETableItem *eti) { @@ -2065,12 +2080,13 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) int col, row; gint cursor_row, cursor_col; - if (e->button.button == 1) { - if (eti->grabbed) { - gtk_grab_remove (GTK_WIDGET (item->canvas)); - gnome_canvas_item_ungrab(item, e->button.time); - } + if (eti->grabbed) { + gtk_grab_remove (GTK_WIDGET (item->canvas)); + gnome_canvas_item_ungrab(item, e->button.time); eti->grabbed = FALSE; + } + + if (e->button.button == 1) { if (eti->maybe_in_drag) { eti->maybe_in_drag = FALSE; if (!eti->maybe_did_something) |