diff options
author | Benjamin Otte <otte@redhat.com> | 2023-04-20 19:07:08 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2023-04-20 23:33:28 +0200 |
commit | f393f70ee23a807d0a4f8c65f0df1407fe87b331 (patch) | |
tree | 096bb5f2fd5d821e4fe3f47f6ebbe9718250c4bb | |
parent | 75c47755e38b77e2b066ce55783c1de3143f5120 (diff) | |
download | gtk+-f393f70ee23a807d0a4f8c65f0df1407fe87b331.tar.gz |
listbase: Don't warn on scroll in empty list
Empty lists can still be scrolled if the scroll happens in the same
frame as the emptying of the list.
Related: #5763
-rw-r--r-- | gtk/gtklistbase.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gtk/gtklistbase.c b/gtk/gtklistbase.c index 0c7df53aa0..0a7dbb0b02 100644 --- a/gtk/gtklistbase.c +++ b/gtk/gtklistbase.c @@ -214,6 +214,11 @@ gtk_list_base_adjustment_value_changed_cb (GtkAdjustment *adjustment, &pos, &cell_area)) { + /* If we get here with n-items == 0, then somebody cleared the list but + * GC hasn't run. So no item to be found. */ + if (gtk_list_base_get_n_items (self) == 0) + return; + g_warning ("%s failed to scroll to given position. Ignoring...", G_OBJECT_TYPE_NAME (self)); return; } |