From a9c8721380e6264c4abbe7fa139e15f2882d06ee Mon Sep 17 00:00:00 2001 From: SoftFever Date: Sat, 3 Oct 2026 14:15:38 +0800 Subject: [PATCH] Add a build-large-panels-hidden rule to the orca-wxwidgets skill --- .../orca-wxwidgets/references/orca-architecture.md | 10 +++++++--- .claude/skills/orca-wxwidgets/references/platforms.md | 8 ++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.claude/skills/orca-wxwidgets/references/orca-architecture.md b/.claude/skills/orca-wxwidgets/references/orca-architecture.md index 801494d802..f7e046e108 100644 --- a/.claude/skills/orca-wxwidgets/references/orca-architecture.md +++ b/.claude/skills/orca-wxwidgets/references/orca-architecture.md @@ -403,9 +403,13 @@ page object to insert and remove by pointer). `LazyPage(parent, name, order, fac factory is `new Panel(parent)`. Its `Show(true)` builds the panel the first time (only once the top-level frame is shown — `MainFrame::Show` completes the start page on the frame's first show) and forwards later shows/hides to the panel, so the panel's own `Show()` override stays its activation -hook. A panel built while its page is hidden stays hidden, and `when_built` gives it the dark-UI pass -the frame ran before it existed (`apply_dark_ui_to_lazy_panel`). `pending()` is true only while the page -is in the book. +hook. The build runs before the placeholder's own `wxPanel::Show(true)`, so an on-demand build creates +its controls in a hidden window as a prebuild does: on MSW each control created or moved inside a +shown window re-clips and repaints its shown siblings, which made a large panel's first show take +seconds. A lazy panel's constructor therefore runs off screen (except the start page's) and must not +rely on `IsShownOnScreen()`. A panel built while its page is hidden stays hidden, and `when_built` +gives it the dark-UI pass the frame ran before it existed (`apply_dark_ui_to_lazy_panel`). +`pending()` is true only while the page is in the book. ### Staged construction: StagedBuild diff --git a/.claude/skills/orca-wxwidgets/references/platforms.md b/.claude/skills/orca-wxwidgets/references/platforms.md index f100b02269..3e67324278 100644 --- a/.claude/skills/orca-wxwidgets/references/platforms.md +++ b/.claude/skills/orca-wxwidgets/references/platforms.md @@ -271,6 +271,14 @@ Each bullet names the mechanism and the file that owns it. - **Painting:** in 3.3.2 windows are not double-buffered by default (the 3.3.0 global `WS_EX_COMPOSITED` was reverted, `docs/changes.txt:308`). Custom widgets buffer by hand → `references/painting-custom-widgets.md`. +- **Building large panels:** every control is a native child window, and outside a sizer pass a move + or resize is immediate, repainting when the window is shown [source: `src/msw/window.cpp:2036` + `DoMoveSibling` → `MSWMoveWindowToAnyPosition(..., IsShown())`]; `wxStaticText::SetLabel`/`SetFont` + resize the control that way (`src/common/stattextcmn.cpp:334` `AutoResizeIfNecessary`). Created + inside a shown parent, each control re-clips and erases its shown, overlapping siblings, so the + cost grows with the number already built and hundreds of controls take seconds. Build a large + panel while its parent is hidden and show it once complete — `LazyPage::Show` builds its panel + before showing the page for this reason → `references/orca-architecture.md` §Deferred construction. - **Modal loops:** idle events do not run inside the Windows sizing/moving modal loop, so the 3D canvas renders from `on_paint` on MSW (c06a0223a7) → `references/webview-gl-aui-media.md` §GLCanvas3D rendering. - **Mouse capture:** `wxEVT_MOUSE_CAPTURE_LOST` and `wxEVT_MOUSE_CAPTURE_CHANGED` are delivered →