switch: Use gtk_widget_contains()
authorBenjamin Otte <otte@redhat.com>
Wed, 1 Nov 2017 19:52:57 +0000 (20:52 +0100)
committerBenjamin Otte <otte@redhat.com>
Wed, 1 Nov 2017 19:52:57 +0000 (20:52 +0100)
gtk/gtkswitch.c

index 659e9edb80345fe5a3ae6ca8d9e4559bbde4994f..d6755a5500a2462634c1b03d4c05457ab31ba8a4 100644 (file)
@@ -205,13 +205,10 @@ gtk_switch_multipress_gesture_released (GtkGestureMultiPress *gesture,
                                         GtkSwitch            *sw)
 {
   GdkEventSequence *sequence;
-  GdkRectangle own_alloc;
 
   sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
 
-  gtk_widget_get_own_allocation (GTK_WIDGET (sw), &own_alloc);
-
-  if (gdk_rectangle_contains_point (&own_alloc, x, y) &&
+  if (gtk_widget_contains (GTK_WIDGET (sw), x, y) &&
       gtk_gesture_handles_sequence (GTK_GESTURE (gesture), sequence))
     gtk_switch_begin_toggle_animation (sw);
 }