Skip to content

fix(gui): erase virtual-list rows freed by a shrink#546

Merged
got3nks merged 1 commit into
amule-org:masterfrom
got3nks:fix/vlist-stale-rows-on-shrink
Jul 21, 2026
Merged

fix(gui): erase virtual-list rows freed by a shrink#546
got3nks merged 1 commit into
amule-org:masterfrom
got3nks:fix/vlist-stale-rows-on-shrink

Conversation

@got3nks

@got3nks got3nks commented Jul 21, 2026

Copy link
Copy Markdown

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. OnPaint only 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 existing wxListMainWindow::RefreshAfter(). OnPaint clears 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 three CMuleVirtualListCtrl lists. 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

  • amulegui peers list: disconnecting clients now clear immediately instead of leaving stale rows until a panel switch.
  • @ghysler is verifying the fixed x64 build, the configuration where it was originally reported.

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).
@got3nks
got3nks merged commit 09c64cb into amule-org:master Jul 21, 2026
14 checks passed
@got3nks
got3nks deleted the fix/vlist-stale-rows-on-shrink branch July 21, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant