• Philip Withnall's avatar
    gtklistbox: Only unparent header rows if they haven’t been reused · 8ce68a51
    Philip Withnall authored
    It’s possible for code which uses a `GtkListBox` to reuse a single
    header row, and move it around between rows. For example, this might
    happen if the code has interactive widgets (like buttons) in the row,
    and doesn’t want to continually recreate them and reattach signals to
    them whenever the row headers change.
    Unfortunately, this was broken, as the old header widget was
    unconditionally unparented, even if it had just been set as the header
    for a different row in the same `GtkListBox`. This left it assigned as
    a child widget in the `GtkListBox` (so it was iterated over by
    `forall`), but without its parent widget set.
    Fix that by only unparenting the header if it hasn’t already been
    assigned as the parent of a different row.
    Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
gtklistbox.c 128 KB