summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Schwinn <alexxcons@xfce.org>2021-08-27 10:23:14 +0200
committerAlexander Schwinn <alexxcons@xfce.org>2021-08-27 10:24:53 +0200
commit4627fdb8f87997725115f326a0918762822ee4fe (patch)
tree6168c654404b9d5372ad39eaac0722ef954a5b60
parentf2eff9707f8eee6953f5f72c27ce26c6448a8c89 (diff)
downloadexo-4627fdb8f87997725115f326a0918762822ee4fe.tar.gz
Add typecheck to prevent Gtk-CRITICAL (Issue #63)
-rw-r--r--exo/exo-tree-view.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/exo/exo-tree-view.c b/exo/exo-tree-view.c
index d3b121a..4ed61b5 100644
--- a/exo/exo-tree-view.c
+++ b/exo/exo-tree-view.c
@@ -359,10 +359,13 @@ exo_tree_view_button_press_event (GtkWidget *widget,
*/
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
- /* Re-enable selection updates */
- if (G_LIKELY (gtk_tree_selection_get_select_function (selection) == (GtkTreeSelectionFunc) (void (*)(void)) exo_noop_false))
+ if (GTK_IS_TREE_SELECTION (selection))
{
- gtk_tree_selection_set_select_function (selection, (GtkTreeSelectionFunc) (void (*)(void)) exo_noop_true, NULL, NULL);
+ /* Re-enable selection updates */
+ if (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);
+ }
}
/* release the path (if any) */