[gtk: 2/3] stack: Fix check if page is selected
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk: 2/3] stack: Fix check if page is selected
- Date: Wed, 24 Mar 2021 20:34:49 +0000 (UTC)
commit e211740da6ced87ec59a7231be2e3fba64d2dfb2
Author: Mohammed Sadiq <sadiq sadiqpk org>
Date: Wed Mar 24 20:23:09 2021 +0530
stack: Fix check if page is selected
When there is no visible child, gtk_selection_model_is_selected()
was returning TRUE for any invalid position.
So check if the page is non-NULL and match
gtk/gtkstack.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c
index 9b1488b3b2..e784b0c30f 100644
--- a/gtk/gtkstack.c
+++ b/gtk/gtkstack.c
@@ -562,7 +562,7 @@ gtk_stack_pages_is_selected (GtkSelectionModel *model,
page = g_list_nth_data (priv->children, position);
- return page == priv->visible_child;
+ return page && page == priv->visible_child;
}
static void set_visible_child (GtkStack *stack,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]