Skip to content
Snippets Groups Projects
Commit b03e6d25 authored by Reuben Green's avatar Reuben Green
Browse files

Add check for valid GtkTreeSelection (issue #40)

Add a check to ensure that a GtkTreeSelection is still valid after
chaining up. This fixes a bug that was exposed by adding directory
specific setting to Thunar (see issue thunar#3521).
parent 81caf3d5
No related branches found
No related tags found
1 merge request!18Add check for valid GtkTreeSelection (issue #40)
Pipeline #2272 passed
...@@ -354,8 +354,11 @@ exo_tree_view_button_press_event (GtkWidget *widget, ...@@ -354,8 +354,11 @@ exo_tree_view_button_press_event (GtkWidget *widget,
/* call the parent's button press handler */ /* call the parent's button press handler */
result = (*GTK_WIDGET_CLASS (exo_tree_view_parent_class)->button_press_event) (widget, event); result = (*GTK_WIDGET_CLASS (exo_tree_view_parent_class)->button_press_event) (widget, event);
/* re-enable selection updates */ /* Re-enable selection updates. Note that since we have already "chained up" by calling the parent's button press handler,
if (G_LIKELY (gtk_tree_selection_get_select_function (selection) == (GtkTreeSelectionFunc) (void (*)(void)) exo_noop_false)) * we must check that the selection is still valid with GTK_IS_TREE_SELECTION.
*/
if (GTK_IS_TREE_SELECTION (selection) &&
G_LIKELY (gtk_tree_selection_get_select_function (selection) == (GtkTreeSelectionFunc) (void (*)(void)) exo_noop_false))
{ {
gtk_tree_selection_set_select_function (selection, (GtkTreeSelectionFunc) (void (*)(void)) exo_noop_true, NULL, NULL); gtk_tree_selection_set_select_function (selection, (GtkTreeSelectionFunc) (void (*)(void)) exo_noop_true, NULL, NULL);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment