summaryrefslogtreecommitdiff
path: root/gtk/gtklist.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/gtklist.c')
-rw-r--r--gtk/gtklist.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk/gtklist.c b/gtk/gtklist.c
index 063041c60d..ead9f98a97 100644
--- a/gtk/gtklist.c
+++ b/gtk/gtklist.c
@@ -698,12 +698,12 @@ gtk_list_button_press (GtkWidget *widget,
list = GTK_LIST (widget);
item = gtk_get_event_widget ((GdkEvent*) event);
- if (!item)
- return FALSE;
-
- while (!gtk_type_is_a (GTK_WIDGET_TYPE (item), gtk_list_item_get_type ()))
+ while (item && !GTK_IS_LIST_ITEM (item))
item = item->parent;
+ if (!item || (item->parent != widget))
+ return FALSE;
+
gtk_list_select_child (list, item);
return FALSE;