Summary
Restoring the Dock layout from persisted state via Dock.load_state() corrupts Makepad's internal DrawList references, causing the entire main content area (rooms list + room tabs) to render as a blank grey page after app restart.
Symptoms
- Left navigation bar renders correctly
- Main content area (Dock with RoomsSideBar + room tabs) is completely blank/grey
- Console floods with
Drawlist id generation wrong errors:
[E] draw_list.rs:324: Drawlist id generation wrong index: 21 current gen:1 in pointer:0
Root Cause
Dock.load_state() (Makepad widgets/src/dock.rs:1310) destroys DrawList2d objects by calling self.tab_bars.clear() during event handling. The Makepad rendering pipeline still holds cached DrawListId references from the previous frame, causing generation mismatches when the freed pool entries are accessed.
Key sequence:
- First draw creates tab_bars with DrawList2d at pool index N, generation 0
RestoreAppStateFromPersistentState triggers load_state() during event handling
tab_bars.clear() drops DrawList2d → pool[N].generation increments to 1
- Next frame accesses stale DrawListId(N, gen=0) → generation mismatch → blank rendering
Reproduction
- Run the app, log in, open some room tabs
- Close the app (state persists to
latest_app_state.json)
- Restart → blank main page
Verification: Deleting latest_app_state.json → UI renders correctly with 0 DrawList errors.
Fix Applied
Replaced dock.load_state(dock_items) in load_dock_state_from() with programmatic tab recreation via close_all_tabs() + focus_or_create_tab(), which uses the Dock's normal widget API and avoids direct DrawList destruction.
See issues/001-dock-load-state-drawlist-corruption.md for full details.
Remaining Issues
Environment
- Makepad:
kevinaboos/makepad@stack_nav_improvements (461b0513)
- Platform: macOS (Darwin 24.5.0)
Summary
Restoring the Dock layout from persisted state via
Dock.load_state()corrupts Makepad's internal DrawList references, causing the entire main content area (rooms list + room tabs) to render as a blank grey page after app restart.Symptoms
Drawlist id generation wrongerrors:Root Cause
Dock.load_state()(Makepadwidgets/src/dock.rs:1310) destroysDrawList2dobjects by callingself.tab_bars.clear()during event handling. The Makepad rendering pipeline still holds cachedDrawListIdreferences from the previous frame, causing generation mismatches when the freed pool entries are accessed.Key sequence:
RestoreAppStateFromPersistentStatetriggersload_state()during event handlingtab_bars.clear()drops DrawList2d → pool[N].generation increments to 1Reproduction
latest_app_state.json)Verification: Deleting
latest_app_state.json→ UI renders correctly with 0 DrawList errors.Fix Applied
Replaced
dock.load_state(dock_items)inload_dock_state_from()with programmatic tab recreation viaclose_all_tabs()+focus_or_create_tab(), which uses the Dock's normal widget API and avoids direct DrawList destruction.See
issues/001-dock-load-state-drawlist-corruption.mdfor full details.Remaining Issues
Dock.load_state()should properly handle DrawList lifecycle when called during event handling (needs fix inkevinaboos/makepadstack_nav_improvementsbranch)SETTINGS_BUTTON_HEIGHTundefined inaccount_settings.rs:63,86Environment
kevinaboos/makepad@stack_nav_improvements(461b0513)