fix(gui): erase virtual-list rows freed by a shrink#546
Merged
Conversation
When items were removed from a virtual list, RefreshFromRow() clamped the repaint range to the new (smaller) item count, so the rows below it were never invalidated. On an erase those pixels kept their old content: stale, non-clickable rows lingered at the bottom of the client / download / shared lists until a panel switch forced a full repaint. Repaint from the first shifted row down to the bottom of the client area via a new wxGenericListCtrl::RefreshAfter() forwarder instead of the count-clamped RefreshItems(). OnPaint clears the whole update region first, so the freed tail is redrawn as background. Fixes all three CMuleVirtualListCtrl lists; reported for the shared-file peers list (amule-project#399).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When rows are removed from a virtual list (clients, downloads, shared files), the leftover rows below the new count stayed painted on screen — stale, non-clickable rows that only cleared on a full repaint (e.g. switching panels).
Root cause
CMuleVirtualListCtrl::RefreshFromRow()clamped its repaint range to the new (smaller) item count after an erase, so the strip below the last surviving row was never invalidated.OnPaintonly clears the update region, so those pixels kept their old content.Fix
Repaint from the first shifted row down to the bottom of the client area instead of stopping at the last item, via a new
wxGenericListCtrl::RefreshAfter()forwarder to the existingwxListMainWindow::RefreshAfter().OnPaintclears the whole update region first, so the freed tail is redrawn as background.Because the fix lives in the shared
RefreshFromRow()path, one change covers all threeCMuleVirtualListCtrllists. It surfaced on the shared-file peers list in #399 (client rows lingering after peers disconnect), but the same repaint gap existed on the download and shared-files lists.Testing