Skip to content

fix(amule): persist Messages columns + minimized window geometry - #138

Merged
got3nks merged 2 commits into
amule-org:masterfrom
got3nks:fix/persist-friend-cols-and-minimized-pos
Jun 13, 2026
Merged

fix(amule): persist Messages columns + minimized window geometry#138
got3nks merged 2 commits into
amule-org:masterfrom
got3nks:fix/persist-friend-cols-and-minimized-pos

Conversation

@got3nks

@got3nks got3nks commented Jun 13, 2026

Copy link
Copy Markdown

Refs #137 (Messages-tab columns + minimized-exit geometry parts).

The Downloads, Shared files, Networks, Searches and Messages tabs all use CMuleListCtrl for their lists, but only Messages had its CFriendListCtrl ctor calling neither SetTableName() nor naming the column it inserts. Result: ~CMuleListCtrl short-circuited on the empty-name guard and nothing was ever written under /eMule/TableWidthsFriend. Column widths in Messages reset on every restart.

Separately, CamuleDlg::SaveGUIPrefs wraps the whole MAIN_X_POS / MAIN_Y_POS / MAIN_X_SIZE / MAIN_Y_SIZE / Maximized block in if (!IsIconized()), so a user who closes the app from a taskbar/dock minimized state has their last layout dropped — next launch falls back to wx defaults.

Commits

  1. fix(messages): persist column widths on the Friend list — Name the single column "N" (matching the other lists' single-char convention), call SetTableName("Friend") and LoadSettings() in the ctor.
  2. fix(amule): preserve window geometry when exiting from a minimized state — Snapshot the frame's pos / size / Maximized into new m_lastShown* members on every Move / Size event while NOT iconized, and have SaveGUIPrefs fall back to that cache when the live frame is iconized. Iconized GetPosition() returns sentinel values on Windows (-32000, -32000) which aren't safe to round-trip, so it's still excluded from the live path.

Out of scope

#137 also lists Downloads / Shared column widths as not persisting; code-side the wiring looks complete (SetTableName("Download") / SetTableName("Shared"), named columns, dtor SaveSettings(), splitter saves). Tested on a Windows VM against this branch and column widths + hidden columns + "Show clients for all files" all persist correctly. Leaving #137 open until the reporter can verify on a packaged build whether their experience changes.

Test plan

Verified on Windows VM with the two-commit branch installed as portable:

  • Resize Downloads + Shared columns → persist across restart.
  • Hide a column in Downloads + Shared → persist.
  • Change "Show clients for all files" in Shared → persist.
  • Resize main window → persist.
  • Minimize to tray → exit from tray menu → re-launch → geometry matches last shown size + position.
  • Friend (Messages) column width → persist.

macOS + monolithic build verified clean (BUILD_MONOLITHIC=YES BUILD_REMOTEGUI=YES BUILD_DAEMON=YES).

got3nks added 2 commits June 13, 2026 09:59
CFriendListCtrl never called SetTableName(), so CMuleListCtrl::SaveSettings
short-circuited on the empty-name guard and nothing was ever written
under /eMule/TableWidths*. InsertColumn was also called without a column
name, so even with SetTableName there was nothing to save.

Tag the lone column with name "N" (matching the other lists' single-char
naming convention) and call SetTableName("Friend") + LoadSettings() in
the ctor.

Reported in amule-project#137.
CamuleDlg::SaveGUIPrefs gated all of MAIN_X_POS / MAIN_Y_POS /
MAIN_X_SIZE / MAIN_Y_SIZE / Maximized behind "if (!IsIconized())", so a
user who closed the app from a taskbar/dock minimized state never had
their last layout written. Next launch fell back to wx defaults.

Snapshot the frame's geometry on every Move/Size event while NOT
iconized into a new m_lastShown* cache, and have SaveGUIPrefs fall back
to that cache when the live frame is iconized. Iconized GetPosition()
returns sentinel values (e.g. -32000,-32000 on Windows) which isn't
safe to round-trip, so it's still excluded from the live path.

Reported in amule-project#137.
@got3nks
got3nks merged commit 40e5419 into amule-org:master Jun 13, 2026
10 checks passed
@got3nks
got3nks deleted the fix/persist-friend-cols-and-minimized-pos branch June 13, 2026 08: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