Fix blank main page caused by Dock.load_state() DrawList corruption#46
Merged
ZhangHanDong merged 2 commits intomainfrom Apr 3, 2026
Merged
Conversation
Dock.load_state() destroys DrawList2d objects by clearing tab_bars during event handling, but the rendering pipeline still holds stale DrawListId references from the previous frame. This causes massive "Drawlist id generation wrong" errors and a completely blank main content area. Replace dock.load_state() 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. Fixes #45 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Dock.load_state()destroysDrawList2dobjects during event handling, corrupting Makepad's internal DrawList referencesdock.load_state()with programmatic tab recreation viaclose_all_tabs()+focus_or_create_tab()Details
When restoring persisted dock state,
Dock.load_state()callsself.tab_bars.clear()which dropsTabBarWrapinstances containingDrawList2d. This frees the DrawList pool entries (incrementing generation), but the rendering pipeline still holds staleDrawListIdreferences from the previous frame, causing massiveDrawlist id generation wrongerrors.Before fix: ~50+ DrawList errors per frame, blank main page
After fix: 0 DrawList errors, all rooms render correctly
Known limitations
Dock.load_state()bug is fixedFixes #45
Test plan
🤖 Generated with Claude Code