[libhandy] carousel-box: Check if the widget is a child in scroll_to()



commit 9750f93f34482251445db49ccfba175d55ecdca5
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Thu Sep 23 12:53:33 2021 +0500

    carousel-box: Check if the widget is a child in scroll_to()

 src/hdy-carousel-box.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/src/hdy-carousel-box.c b/src/hdy-carousel-box.c
index f6b6279c..d3aab027 100644
--- a/src/hdy-carousel-box.c
+++ b/src/hdy-carousel-box.c
@@ -1393,6 +1393,7 @@ hdy_carousel_box_scroll_to (HdyCarouselBox *self,
   g_return_if_fail (HDY_IS_CAROUSEL_BOX (self));
   g_return_if_fail (GTK_IS_WIDGET (widget));
   g_return_if_fail (duration >= 0);
+  g_return_if_fail (gtk_widget_get_parent (widget) == GTK_WIDGET (self));
 
   child = find_child_info (self, widget);
   position = child->snap_point;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]