Commit cacccf7a authored by Carlos Garnacho's avatar Carlos Garnacho

popover: Check for uncaught button events from children

And deal correctly with those as a click within the popover.

https://bugzilla.gnome.org/show_bug.cgi?id=727994
parent e2cd59b7
......@@ -1162,13 +1162,15 @@ gtk_popover_button_release (GtkWidget *widget,
GdkEventButton *event)
{
GtkPopover *popover = GTK_POPOVER (widget);
GtkWidget *child;
GtkWidget *child, *event_widget;
child = gtk_bin_get_child (GTK_BIN (widget));
if (!popover->priv->button_pressed)
return GDK_EVENT_PROPAGATE;
event_widget = gtk_get_event_widget ((GdkEvent *) event);
if (child && event->window == gtk_widget_get_window (widget))
{
GtkAllocation child_alloc;
......@@ -1181,7 +1183,7 @@ gtk_popover_button_release (GtkWidget *widget,
event->y > child_alloc.y + child_alloc.height)
gtk_widget_hide (widget);
}
else
else if (!gtk_widget_is_ancestor (event_widget, widget))
gtk_widget_hide (widget);
return GDK_EVENT_PROPAGATE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment