Skip to content

fix(remote-gui): Windows repaint fixes — log-view blanking (#445) + list rows blanking on scroll/keyboard (#478)#477

Merged
got3nks merged 2 commits into
amule-org:masterfrom
got3nks:fix/remote-log-blank-freeze
Jul 14, 2026
Merged

fix(remote-gui): Windows repaint fixes — log-view blanking (#445) + list rows blanking on scroll/keyboard (#478)#477
got3nks merged 2 commits into
amule-org:masterfrom
got3nks:fix/remote-log-blank-freeze

Conversation

@got3nks

@got3nks got3nks commented Jul 13, 2026

Copy link
Copy Markdown

Two Windows-only aMuleGUI repaint fixes reported by @ghysler.

1. Log view blanks on every new line (#445) — confirmed fixed

Follow-up to #471. #471 thawed the control before scrolling, but AppendText still ran while the control was frozen; on Windows, appending to a frozen wxTE_RICH2 leaves its line/scroll metrics stale, so on Thaw() the view blanks until a manual scroll. Fix: drop the Freeze()/Thaw() and append on a live control, keeping the #451 wins (daemon 5000-lines/poll, conditional SetDefaultStyle, one coalesced ShowPosition per poll). ghysler confirmed fixed.

2. List rows disappear on scroll — mouse and keyboard (#478)

Regression from #348, which replaced the vendored wxListMainWindow::OnScroll's synchronous HandleOnScroll(event) with event.Skip() (wx 3.3.3 made HandleOnScroll private, breaking the macOS/Linux CI). On wxMSW the resulting deferred-scroll path (wxScrollHelperBase::HandleOnScrollScrollWindow) blits the retained rows and only invalidates the newly-exposed strip, which is then left unpainted — rows blank on wheel/scrollbar/pagination scrolling. Verified in both the wx 3.2.10 and 3.3.x sources that the scroll+repaint mechanism is identical, so it's a wxMSW platform behavior, not a wx-version one.

Rather than gate on platform or wx version (the former needs the now-private HandleOnScroll; the latter breaks once Windows ships wx 3.3.3), reimplement the synchronous scroll using only the public wxScrollHelper API (GetViewStart / GetScrollLines / GetScrollPageSize / Scroll), mirroring HandleOnScroll()/CalcScrollInc().

The "scroll + repaint" sequence is factored into a shared ScrollListTo(x, y) helper (Update() to flush pending paints so the blit is clean → Scroll()ResetVisibleLinesRange() so the exposed rows repaint), and both OnScroll (scrollbar/wheel) and MoveToItem (keyboard nav) go through it. That also fixes the keyboard HOME/END/PgUp/PgDn blanking — same bug, different path: MoveToItem only reset the visible-line range after Scroll() under __WXMAC__, so on Windows it stayed stale and keyboard scrolls came up blank. The reset now runs on every platform via the shared helper.

Not skipping the event means the base helper won't also scroll (no double-scroll). Works on every supported wx (≥ 3.2.0) and every platform, no version or platform guard, and compiles against wx 3.3.3.

Both are client-side, GUI-rendering only — no daemon or EC protocol change.

…eeze/Thaw (amule-project#445)

amule-project#471 tried to fix the "log view goes blank on every new line" Windows
regression by thawing before scrolling, but it made no difference: the
AppendText still ran while the control was frozen. Appending to a frozen
wxTE_RICH2 (RichEdit) on Windows leaves its line/scroll metrics stale, so on
Thaw the view renders blank with the newest line pinned to the top until a
manual scroll forces a recompute. The Freeze()/Thaw() that amule-project#451 wrapped the
per-poll appends in is the actual culprit, not the scroll order.

Drop the Freeze()/Thaw() and append on a live control (as the pre-amule-project#451 code
did). Keep the two real wins from amule-project#451: the daemon's 5000-lines-per-poll cap
and the conditional SetDefaultStyle, plus one coalesced ShowPosition per poll
instead of per line (m_logBatching still suppresses the per-line scroll). The
per-line SetDefaultStyle was the dominant first-sync cost, so responsiveness is
retained without the frozen-append rendering corruption.

macOS/GTK recompute metrics regardless and were unaffected either way.
@got3nks got3nks changed the title fix(remote-gui): stop the log view blanking on Windows (drop Freeze/Thaw) (#445) fix(remote-gui): Windows repaint fixes — log-view blanking (#445) + list rows disappearing on scroll (#478) Jul 13, 2026
@got3nks got3nks force-pushed the fix/remote-log-blank-freeze branch 2 times, most recently from fc4f3e1 to 0996407 Compare July 14, 2026 06:45
amule-project#478)

amule-project#348 replaced the vendored wxListMainWindow::OnScroll's synchronous
HandleOnScroll(event) with event.Skip() -- HandleOnScroll became a private
member in wx 3.3.3, so the macOS/Linux CI (on wx 3.3.x) stopped compiling. On
wxMSW the resulting deferred-scroll path (wxScrollHelperBase::HandleOnScroll ->
ScrollWindow) blits the retained rows and only invalidates the newly exposed
strip, which is then left unpainted: rows go blank on mouse-wheel, scrollbar and
pagination scrolling until a redraw is forced. Verified in the wx 3.2.10 and
3.3.x sources that the scroll+repaint mechanism is identical, so this is a wxMSW
platform behavior, not a wx-version one.

Rather than gate on platform or wx version (both fragile -- the former needs the
now-private HandleOnScroll, the latter breaks once Windows ships wx 3.3.3),
reimplement the synchronous scroll using only the public wxScrollHelper API
(GetViewStart / GetScrollLines / GetScrollPageSize / Scroll), mirroring
HandleOnScroll()/CalcScrollInc(): translate the scroll event into a target
position in scroll units and scroll to it.

Factor the "scroll + repaint" sequence into a shared ScrollListTo(x, y) helper
(Update() to flush pending paints so the blit is clean, Scroll(), then
ResetVisibleLinesRange() so the exposed rows repaint) and route both OnScroll
(scrollbar/wheel) and MoveToItem (keyboard nav) through it. This also fixes the
keyboard HOME/END/PgUp/PgDn blanking, which was the same bug from a different
path: MoveToItem only reset the visible-line range after Scroll() under
__WXMAC__, so on Windows the range stayed stale and keyboard scrolls came up
blank. The reset now runs on every platform via the shared helper, and the old
__WXMAC__-only workaround is gone.

Not skipping the event means the base scroll helper won't also scroll, so no
double-scroll. Works on every supported wx (>= 3.2.0) and every platform with no
version or platform guard; compiles against wx 3.3.3.

Refs amule-project#478
@got3nks got3nks force-pushed the fix/remote-log-blank-freeze branch from 0996407 to e8230f1 Compare July 14, 2026 08:07
@got3nks got3nks changed the title fix(remote-gui): Windows repaint fixes — log-view blanking (#445) + list rows disappearing on scroll (#478) fix(remote-gui): Windows repaint fixes — log-view blanking (#445) + list rows blanking on scroll/keyboard (#478) Jul 14, 2026
@got3nks got3nks merged commit 0dbb5f5 into amule-org:master Jul 14, 2026
12 checks passed
@got3nks got3nks deleted the fix/remote-log-blank-freeze branch July 14, 2026 08:39
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