Removing an item from the ModeButton widget renders consecutive item indexes invalid
Bug #1066136 reported by
Victor Martinez
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Granite |
Fix Released
|
Medium
|
Victor Martinez |
Bug Description
The current implementation of ModeButton.remove uses Gtk.Widget.destroy to remove an item from the widget. Since the widget's children list is obviously altered after that, the remove() method invalidates the indexes of the items that were following the index which was removed (e.g. if the removed item had index 4, then the current item 5 will be 4, and similarly for the rest of consecutive items).
Test attached (compile with vala 0.18 to get useful assertion messages).
Related branches
lp:~elementary-pantheon/granite/lp-1066136
- David Gomes (community): Approve
-
Diff: 179 lines (+59/-36)1 file modifiedlib/Widgets/ModeButton.vala (+59/-36)
summary: |
- Removing an item from the ModeButton widget renders consecutive items - invalid + Removing an item from the ModeButton widget renders consecutive item + indexes invalid |
Changed in granite: | |
status: | In Progress → Fix Committed |
Changed in granite: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
The linked branch fixes the problem. It passes the test attached to the bug report.