summaryrefslogtreecommitdiff
path: root/gtk/gtkswitch.c
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2018-04-07 13:37:24 +0200
committerTimm Bäder <mail@baedert.org>2018-04-10 09:43:47 +0200
commit3ce6355bf4ba0ac1d3c3e4f637babdbf4b85b91c (patch)
treec5e40c3c2719efb62c0d23ed89ab5703cda99e22 /gtk/gtkswitch.c
parent3a5b2f54ea2d09fd9f1ed48ff90a32a77d83edc1 (diff)
downloadgtk+-3ce6355bf4ba0ac1d3c3e4f637babdbf4b85b91c.tar.gz
widget: Remove _get_own_allocation
Replace all usages of it with _compute_bounds
Diffstat (limited to 'gtk/gtkswitch.c')
-rw-r--r--gtk/gtkswitch.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk/gtkswitch.c b/gtk/gtkswitch.c
index fb3b21f732..2116eafcf2 100644
--- a/gtk/gtkswitch.c
+++ b/gtk/gtkswitch.c
@@ -188,16 +188,16 @@ gtk_switch_multipress_gesture_pressed (GtkGestureMultiPress *gesture,
GtkSwitch *sw)
{
GtkSwitchPrivate *priv = gtk_switch_get_instance_private (sw);
- GtkAllocation allocation;
+ graphene_rect_t switch_bounds;
- gtk_widget_get_outer_allocation (GTK_WIDGET (sw), &allocation);
+ gtk_widget_compute_bounds (GTK_WIDGET (sw), GTK_WIDGET (sw), &switch_bounds);
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
/* If the press didn't happen in the draggable handle,
* cancel the pan gesture right away
*/
- if ((priv->is_active && x <= allocation.width / 2.0) ||
- (!priv->is_active && x > allocation.width / 2.0))
+ if ((priv->is_active && x <= switch_bounds.size.width / 2.0) ||
+ (!priv->is_active && x > switch_bounds.size.width / 2.0))
gtk_gesture_set_state (priv->pan_gesture, GTK_EVENT_SEQUENCE_DENIED);
}