Add a build-large-panels-hidden rule to the orca-wxwidgets skill

This commit is contained in:
SoftFever
2026-10-03 19:05:53 +08:00
parent 815716a4b5
commit a9c8721380
2 changed files with 15 additions and 3 deletions
@@ -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
@@ -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 →