mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-18 09:00:34 +00:00
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
This commit is contained in:
parent
e2cd59b731
commit
cacccf7a3a
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user