paned: Restrict picking to allocation

Same reason as GtkViewport does it: We might allocate child widgets
outside of the paned's content allocation. For drawing, we add a clip
node.

This was causing the "Record" button in the inspector recorder to ignore
pointer events since the treeview column header label in the GtkPaned
was swallowing it.
This commit is contained in:
Timm Bäder 2017-12-06 08:23:03 +01:00
parent 1aa811ce12
commit 49e624bbe9

View File

@ -332,6 +332,25 @@ gtk_paned_motion_notify (GtkWidget *widget,
return GTK_WIDGET_CLASS (gtk_paned_parent_class)->motion_notify_event (widget, event);
}
static GtkWidget *
gtk_paned_pick (GtkWidget *widget,
double x,
double y)
{
if (x >= 0 && x <= gtk_widget_get_width (widget) &&
y >= 0 && y <= gtk_widget_get_height(widget))
{
return GTK_WIDGET_CLASS (gtk_paned_parent_class)->pick (widget, x, y);
}
else
{
if (gtk_widget_contains (widget, x, y))
return widget;
else
return NULL;
}
}
static void
gtk_paned_class_init (GtkPanedClass *class)
{
@ -357,6 +376,7 @@ gtk_paned_class_init (GtkPanedClass *class)
widget_class->focus = gtk_paned_focus;
widget_class->motion_notify_event = gtk_paned_motion_notify;
widget_class->direction_changed = gtk_paned_direction_changed;
widget_class->pick = gtk_paned_pick;
container_class->add = gtk_paned_add;
container_class->remove = gtk_paned_remove;