widget: Make sure we're not calling _get_parent on NULL

We already issue the first _get_parent call before even entering that
loop, so make sure `parent` is not NULL. This happens when event_widget
is already a toplevel, and this change fixes row-dragging in treeviews.
This commit is contained in:
Timm Bäder 2017-05-10 18:08:43 +02:00 committed by Carlos Garnacho
parent 34fdc51392
commit eef33d34d4

View File

@ -3585,7 +3585,7 @@ _gtk_widget_emulate_press (GtkWidget *widget,
next_child = event_widget;
parent = _gtk_widget_get_parent (next_child);
while (parent != widget)
while (parent && parent != widget)
{
next_child = parent;
parent = _gtk_widget_get_parent (parent);