A layer opened in a palette window shows in a popup window of its own. Its host asked in the opener's viewport whether the layer appears in this pass, and only the popup's pass recorded that it had, so the layer appeared in every pass and forgot everything in between. The arrow keys never left a menu's first row, a menu hung at the pointer jumped while the pointer was over it, and a scrolled flyout went back to its top. The host now records the appearance in the opener's viewport too (`overlay::note_appeared`, split out of `begin_layer`), so both viewports agree.
With its memory kept, such a layer takes the two rules an in-window layer has: a right-click on its context opener hangs it at the new pointer (`recall_shown`, shared by both hosts), and the press that opened it from another window does not close it when the opener runs a second pass of the opening frame.
The window kit's `send` gives events to one child window, such as a popup's.
Every pass's end hook dropped the per-viewport records of viewports its input did not list. That list dates from the
frame's start, so the root's end hook dropped the records of a window the frame had opened. A palette that opened
hidden under an open menu lost the note that it was hidden, and stayed hidden once the menu was gone: Float in a docked
tab's menu left no window to see when the opening frame ran a second pass. The root's begin hook now drops the records
of closed viewports in a frame's first pass, where the list names every window opened before.
The OS gives an OS window no press that went down in another window, so DockArea::continue_move had no effect
on a window the dock opens as one. The window shows in the app window while the press moves it: it follows the
pointer, marks where it would land and docks on release, as a tab drag does.
A dock panel's OS window gets its keys alone, so an Escape pressed there with
nothing focused became that window's Cancel, which no app code reads: a command
started from a floated palette could not be cancelled. The end hook hands a Cancel
left in such a window (`WindowSpec::hands_on_cancel`) to the window it was opened
from, which reads it as its own in its next pass. A popup or a modal open in the
floated window keeps the Escape, and a modal that opened meanwhile drops it.
One conflict, in docs/ui-docking.md: next added bullets for tab presses keeping
key focus and for floating windows stacking with app windows next to our
split-handle bullet. Kept our split-handle sentence (a pointer press or drag on
a handle leaves key focus) and next's two new bullets after it.
The Rust files merged cleanly. next still has dividers that take focus on a
press, the flyout room limited to the space below its top, and no RailTool
icon, so none of this branch's changes is covered by next.
next carries dock-gaps (#3383), whose IME commit a0b1c35a8f is the same change as
this branch's 8c2cd95de3, and Skylar's focus and text-field work.
Conflicts:
- runtime/ime.rs, runtime/egui/ime.rs, testing/host_key_trials.rs: next's only
change to these files is a0b1c35a8f, which this branch already holds and has
replaced with the fence built on egui's pending_ime_reset (a3a58be575). This
branch's side is kept. a0b1c35a8f's trial stays in its adapted form
(an_app_editor_s_own_reset_at_the_press_reaches_it_and_it_composes_again, run
with the reset in the output and through egui alone).
- runtime/egui/fixture.rs: ResettingEditor and host_resetting_ime_editor keep
this branch's form (in_output, ask, a press inside the editor's rect). next's
root focus fact in run_frame (ea6febd719) merged cleanly.
- runtime/focus.rs: State keeps candidates_seen and takes next's
surrender_after_scopes and surrender_deferred; tab_to_egui stays removed. The
end hook takes the app's egui widgets first, then runs next's deferred and
after-scopes surrenders; next's block that surrendered a component widget
egui's Tab focused goes with the removed egui-Tab path.
No code in next calls host_stop or the removed egui-Tab path.
The windows kit's renderer shares one texture store between the windows, as
eframe's does, applies each window's texture changes when it paints and panics
on a change to a texture it has not allocated. A frame whose first pass asks
for another and whose second shows a dock with a native float, as an app's
start-up, paints its float's window without that panic.
TabStripOutput reports the overflow button's rect and access node id while
some tabs do not fit. The dock group passes it on (DockGroupOutput::overflow,
through the memoized tab row so a replay moves it with the row), and the dock
area reports it beside the group's tabs as SourceKind::Overflow, named by the
group's first panel, so a host can give the button an automation id.
A host body keeps its presses and its egui focus, so the group takes
no focus and DockAreaOutput::focused never names the panel clicked
into. BodyCx::pressed_within reports a primary press in the body's
rect on its layer whatever took it, sharing the press geometry with
surface_pressed, and the dock area reports the group's shown panel as
pressed.
drag::start took the source container's layer from the layers shown last
frame. A window floated in the pass before it continues a press (a rail
popup dragged out) runs its body, and so starts its drag, before its first
layer is recorded, so the session moved no layer: drop targets did not look
through the dragged window, and on release the window's own drop target,
the top layer under the pointer, took the drop and refused it, leaving the
panel floating. moving_layer now reads the source's layer from the layers
shown last frame at each hit test. The plain-egui hand-over trial floats
its window in the pass the press is handed over, as the app does.
Save for Web's open and palette helpers, its slices test, Export As's scale test
and the New Document card tests wait until the dialog is stable rather than 4 to
30 frames; the card tests run without motion, since they read cards where they
are painted. Clock-timed steps stay as they were.
An app's own popup (TextureCraft's rail popup) senses its title row with
egui, so no arena holds the press it hands to a floated panel's window
through DockArea::continue_move. hand_over_press found no arena press and
the window never followed the pointer, so the panel stayed floating where
the popup was. When no other arena holds a press, the window's move band
takes the primary press from egui's pointer state; a press held by another
arena is handed over as before.
A window that continues a panel's drag (DockArea::continue_move, a rail popup
floated by its tab) began its move as a title-row move, which docks only with
DockConfig::title_bar_docks. The handed-over press now says so through the
move: PressStart::handed (set by PressMachine::take_over) and
PlacementChange::continued on the layer move's reports. FloatingGroup starts
its window drag with GroupDrag::title_row only for a press on its title row,
and DockDropTarget refuses only those when title_bar_docks is off.
A file drop on a floating OS window reports the shown panel of the group under
the drop, from the drop session's pointer; the first group's on the title row or
when no pointer is known. ui-docking.md covers documents, swatches, raise and
WindowFiles.
PanelSpec::documents lists what a panel shows (a Timeline's compositions) as tabs
after the group's panel tabs, in the same strip: one fit, one overflow menu, one
keyboard order. A pick reports DockEvent::DocumentPicked and activates the panel;
a close reports DockEvent::DocumentClosed. PanelSpec::swatch and
PanelDocument::swatch show a data colour in the tab's icon slot.
An OS window gets WindowAction::Focus; a window on a layer goes to the top of
egui's area order through overlay::raise, which now raises floating windows too.
Conflicts resolved so that next's changes and this branch's fixes both hold:
- keys: next's unfocused-canvas state claims join the key stage's framework claims; the canvas's
declared claims stay the host's (egui keeps their presses).
- overlay: the app's own modal (`FrameInput::app_modal`) joins next's modal stack at the frame it
first showed in.
- docking: the tab-pick trial moves key focus into the group with Tab, since a click on a dock tab
leaves key focus where it is.
FloatingGroup::raise is a request of the pass: an OS-window float is raised and focused, a layer's family comes in front of the other layers (overlay::raise), as DocumentWindow::raise does. DockArea::focus sets it on the floating window that holds the focused panel, so a panel the host reveals is not left under another floating window. View state only: the workspace keeps no stacking order. native::raise is the one raise path, for the flag and for the start of a move or resize.
DockArea::focus(panel) is a request of the pass: the group holding the panel picks its tab
(Action::activate in the pass's actions) and its tab row's stop takes key focus while the row
runs, so the next pass's keys route through that group. A titled header focuses its drag band.