A blocked window drops the keys, so a modal opened from a focused float by a key or a command (a save prompt in the main window) got none of them until the user clicked. The modal's window now gets one focus request 0.2 s after it becomes the app's modal, if a window it blocks still has the focus; an OS dialog that opens with the modal takes the focus in that time, and then nothing is sent. The modal's own popup windows keep the keyboard. It covers framework modals and FrameInput::app_modal alike (the docking of the former crate::ui did it for its floats, #306).
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.
An unclaimed press surrendered the focus of a canvas declared with
host_canvas at the press (apply_press), and egui's click-away rule took
a focus the app itself had given the canvas at the release. The press
rule now keeps a declared canvas focused, and the begin hook takes the
focus on it off egui's rule, whoever gave it. A canvas the app no longer
declares follows egui's rule again.
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.
The runtime keeps its surrender rule on the focus it gave an app's own widget
until no pointer button is down, so the release of the press that gave the
focus does not take it back. The record of the given focus ends once egui's
focus is elsewhere. Whether a widget is drawn is read from egui's widgets of
the running pass, for the given focus and for `host_canvas` findings alike.
Focus given to a canvas before `host_canvas` registers it follows the canvas's
keys.
A canvas drawn in a disabled `Ui` is a `canvas-without-widget` finding too;
the finding's text is made only when it is kept, and a fault is logged once.
A widget drawn with the bare Sense::DRAG or Sense::CLICK is not focusable, and
egui takes the focus from it when it is drawn, so Tab is lost there too. The
end hook reads the sense of the canvas's widget and names it in the finding.
Focus that Tab, F6 or a framework request gave an app's own egui widget
kept the runtime's surrender rule (Never) while the runtime's press rule
left that widget to egui, so a press elsewhere released it nowhere. The
end hook of the pass that drew the widget leaves the focus to egui's rule,
the app's `surrender_focus_on`; until then the press or click of the pass
that gave the focus does not take it back. The stop of an app's own widget
sets no Escape filter, so Escape releases it as egui does; the declared
canvas keeps its filter.
egui drops the focus of an id no interactive widget of the pass has, so Tab
lost the focus at such a canvas and started over at the first stop. The end
hook looks each declared canvas up among the pass's widgets and reports
`canvas-without-widget` when it is not there; debug builds log it once.
- ui-panels iconic trial: the two literal 0.5 tolerances are relations (`first` above the
gripped first icon; the rule `near` the middle of the room).
- ui-shell Column start page: the bottom page margin is `add_space` of the token, not
`allocate_space`.
- ui-widgets Tile: `PAPER` (a blank page, data) and `Tile::page`'s width and height (a
proportion in any one unit) are marked and listed as exceptions.
- docs/components-index.md regenerated (Link's `LinkLook::Plain`).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The focus service takes egui's focus candidates of the pass (Memory::focus_candidates) at every
order-dependent registration and at the end hook: each widget no component made becomes a stop of
the app's own, where it was drawn among the framework's stops, a text stop for a TextEdit. Recorded
views and lazy children replay them with their transcripts.
A bare Tab is the framework's move unless an egui popup is open or the app's focused widget keeps
Tab by its egui key filter. Removed: focus::host_stop and the separate egui-Tab path for windows
without framework stops. The scrim absorber no longer takes key focus.
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.
focus::host_stop registers an app's own egui widget as a focus stop
(Stop::host, as host_canvas does, without marking a document canvas), so a
window that has framework stops and the app's own widgets keeps one framework
Tab order holding both, in registration order.
A canvas keeps Tab only while it has the focus. With nothing focused a bare Tab
moves focus into the window or toggles the panels, even for a canvas that
keeps Tab, as the unfocused canvas's claims already never take Tab: the canvas
cannot trap keyboard navigation. The last assertion of
a_host_canvas_marks_the_window_and_tab_toggles_its_panels changes to this
rule: with nothing focused, the Tab toggles the panels instead of reaching the
canvas in egui. The unused Strip::canvas field goes with the old rule.
While an app's own egui widget or popup has the focus, a plain Enter stays in
egui's input for it and no window Submit comes of it, as with Tab and Escape.
The window's Submit was offered beside the press, so an app editor read one
Enter and an app that returns the window's Submit to egui read two; an app
TextEdit in a framework dialog also fired the dialog's default button. With
nothing focused the plain Enter stays the window's Submit and in egui's input.
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.
Layout memory requests its discard pass from egui in its end hook, after the
app's UI, so Context::will_discard() read by host code during a pass that a
changed size runs again is still false. frame::will_rerun is true when egui
will discard the pass or when this pass asked layout memory for the frame's
discard pass and will get it. Hosts gate frame counts and settle counts on it.
The discard request stays in the end hook, so lazy runs and memoized replays
keep their records of the asking pass.
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.
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.
FrameInput::window_input(WindowInput::Dropped) drops a hosted window's own
events and OS files in the input filter, before injected input joins, so an
agent-driven session's floated panels take only injected input. eframe runs
raw_input_hook for the main window only; the root's input stays the host's.
The test kit's Windows takes the policy; trials cover the drop and a macOS
Control+Click in a hosted window.
next gained DockConfig::panel_menu_always (with its trial a_dock_that_shows_the_panel_menu_always_gives_every_group_the_button), the same choice this branch added as menu_button. The duplicate option, its GroupMenuButton type, its trial and its docs row go; the dock reads only panel_menu_always.
The panel menu button choice was a per-app boolean; the variant rule asks for named options. GroupMenuButton defaults to HostRows, today's behaviour (the button only on groups whose shown panel has host rows). The panel menu trial covers both options and the default, and the DockConfig table in docs/ui-docking.md lists the field.