mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-05 16:20:10 +00:00
guard against people deleting the row in question in the selection-changed
2008-02-12 Kristian Rietveld <kris@imendio.com> * gtk/gtktreeview.c (gtk_tree_view_real_select_cursor_row), (gtk_tree_view_real_toggle_cursor_row): guard against people deleting the row in question in the selection-changed callback. (#514621, Andreas Koehler). svn path=/trunk/; revision=19530
This commit is contained in:
parent
0509519d35
commit
49f20887af
@ -1,3 +1,10 @@
|
||||
2008-02-12 Kristian Rietveld <kris@imendio.com>
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_real_select_cursor_row),
|
||||
(gtk_tree_view_real_toggle_cursor_row): guard against people
|
||||
deleting the row in question in the selection-changed callback.
|
||||
(#514621, Andreas Koehler).
|
||||
|
||||
2008-02-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/*.c: Unify the handling of various "Enter" keysyms
|
||||
|
@ -10081,6 +10081,8 @@ static gboolean
|
||||
gtk_tree_view_real_select_cursor_row (GtkTreeView *tree_view,
|
||||
gboolean start_editing)
|
||||
{
|
||||
GtkRBTree *new_tree = NULL;
|
||||
GtkRBNode *new_node = NULL;
|
||||
GtkRBTree *cursor_tree = NULL;
|
||||
GtkRBNode *cursor_node = NULL;
|
||||
GtkTreePath *cursor_path = NULL;
|
||||
@ -10126,6 +10128,15 @@ gtk_tree_view_real_select_cursor_row (GtkTreeView *tree_view,
|
||||
mode,
|
||||
FALSE);
|
||||
|
||||
/* We bail out if the original (tree, node) don't exist anymore after
|
||||
* handling the selection-changed callback. We do return TRUE because
|
||||
* the key press has been handled at this point.
|
||||
*/
|
||||
_gtk_tree_view_find_node (tree_view, cursor_path, &new_tree, &new_node);
|
||||
|
||||
if (cursor_tree != new_tree || cursor_node != new_node)
|
||||
return FALSE;
|
||||
|
||||
gtk_tree_view_clamp_node_visible (tree_view, cursor_tree, cursor_node);
|
||||
|
||||
gtk_widget_grab_focus (GTK_WIDGET (tree_view));
|
||||
@ -10143,6 +10154,8 @@ gtk_tree_view_real_select_cursor_row (GtkTreeView *tree_view,
|
||||
static gboolean
|
||||
gtk_tree_view_real_toggle_cursor_row (GtkTreeView *tree_view)
|
||||
{
|
||||
GtkRBTree *new_tree = NULL;
|
||||
GtkRBNode *new_node = NULL;
|
||||
GtkRBTree *cursor_tree = NULL;
|
||||
GtkRBNode *cursor_node = NULL;
|
||||
GtkTreePath *cursor_path = NULL;
|
||||
@ -10172,6 +10185,15 @@ gtk_tree_view_real_toggle_cursor_row (GtkTreeView *tree_view)
|
||||
GTK_TREE_SELECT_MODE_TOGGLE,
|
||||
FALSE);
|
||||
|
||||
/* We bail out if the original (tree, node) don't exist anymore after
|
||||
* handling the selection-changed callback. We do return TRUE because
|
||||
* the key press has been handled at this point.
|
||||
*/
|
||||
_gtk_tree_view_find_node (tree_view, cursor_path, &new_tree, &new_node);
|
||||
|
||||
if (cursor_tree != new_tree || cursor_node != new_node)
|
||||
return FALSE;
|
||||
|
||||
gtk_tree_view_clamp_node_visible (tree_view, cursor_tree, cursor_node);
|
||||
|
||||
gtk_widget_grab_focus (GTK_WIDGET (tree_view));
|
||||
|
Loading…
Reference in New Issue
Block a user