[gtk/wip/baedert/transforms5: 259/272] popover: Get rid of a gtk_widget_get_allocation call
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/transforms5: 259/272] popover: Get rid of a gtk_widget_get_allocation call
- Date: Fri, 9 Nov 2018 08:57:15 +0000 (UTC)
commit abc59007faa8f6df44c4a3b7a764d5f6c0b9e756
Author: Timm Bäder <mail baedert org>
Date: Sun Aug 12 13:44:35 2018 +0200
popover: Get rid of a gtk_widget_get_allocation call
Use _compute_bounds instead.
gtk/gtkpopover.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index 94f234c223..81d15d975f 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -326,19 +326,17 @@ gesture_released (GtkGestureMultiPress *gesture,
GtkPopover *popover)
{
GtkPopoverPrivate *priv = gtk_popover_get_instance_private (popover);
- GtkAllocation child_alloc;
+ graphene_rect_t child_bounds;
GtkWidget *child;
if (!priv->button_pressed)
return;
child = gtk_bin_get_child (GTK_BIN (popover));
- gtk_widget_get_allocation (child, &child_alloc);
+ gtk_widget_compute_bounds (child, GTK_WIDGET (popover), &child_bounds);
- if (x < child_alloc.x ||
- x > child_alloc.x + child_alloc.width ||
- y < child_alloc.y ||
- y > child_alloc.y + child_alloc.height)
+ if (!graphene_rect_contains_point (&child_bounds,
+ &(graphene_point_t){x, y}))
gtk_popover_popdown (popover);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]