Files
ltk/debian/changelog
T
admin 58b8dd7b90
CI / build + test (push) Canceled after 0s
CI / cargo audit (push) Canceled after 0s
Focus requests reach widgets clipped by a scroll viewport, and stop retrying after a few frames
A scroll viewport keeps in `widget_rects` only the widgets at least partly inside its visible area (`draw/layout.rs`, the translation of the sub-canvas rects to surface space). A focus request whose target sits below the fold therefore never finds it: `App::take_focus_request` was honoured only for widgets already laid out on screen. The Wi-Fi page of settings is one such case by construction: tapping a secured network inserts the password form under the row and asks for focus on the field, so for a row in the lower part of the list the field is born outside the viewport and the request misses. Worse, the miss branch parked the id in `focus_retry`, marked the view dirty and requested a redraw on every iteration, so the application rebuilt and repainted at the compositor's frame rate for as long as the widget stayed hidden.
The layout pass now records the widgets it drops for carrying a `WidgetId`: `DrawCtx::scroll_clipped` holds `(id, scroll flat_idx, rect)` with the rect in the scroll's content coordinates, the same frame the navigable-item list uses, and `draw_frame` hands it to `FrameState`. When a focus request misses, `AppData::reveal_clipped_widget` looks the id up in that list on the main surface and the overlays, finds the viewport in `scroll_rects`, and moves its offset on the axes the scroll allows so the rect lands inside; the next frame lays the widget out and the retry focuses it. Nested scrolls resolve one viewport per frame.
The rule that computes the new offset is `scroll::offset_into_view`, extracted from the keyboard navigation in `input/keyboard/nav.rs`, which now calls it instead of carrying its own copy; unit tests cover the three cases.
`focus_retry` carries a budget of drawn frames (`FOCUS_RETRY_FRAMES`, four), decremented only on iterations that actually drew, so a request made while a frame callback is pending does not lose its chance. A fresh request from the application replaces a pending retry with a full budget. When the budget runs out the request is dropped, which ends the redraw loop for a widget that never appears.
Documented in the `take_focus_request` doc comment, the cookbook and the changelog; Debian revision 0.3.0-3.
2026-09-14 11:50:27 +02:00

33 lines
2.1 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
ltk (0.3.0-3) unstable; urgency=low
* Focus requests reach widgets clipped by a scroll viewport: the runtime moves the viewport to reveal the target and waits a bounded number of frames instead of redrawing indefinitely.
-- Pedro M. de Echanove Pasquin <pedro.echanove@liberux.net> Mon, 14 Sep 2026 12:00:00 +0200
ltk (0.3.0-2) unstable; urgency=low
* PatternGrid: a 3×3 drag widget for pattern unlock that reports the node under the pointer and the release; the app owns the path. Theme tokens under widget/pattern_grid/theme.rs, AccessKit GenericContainer role, docs, tests and a Security tab in the widgets example.
* Framed icon buttons: icon_button honours width, height and variant and paints the same frame as a text button, so icon keys line up with text keys.
* Keyboard routing: characters, Backspace and Delete stay in a focused text input and reach App::on_key otherwise, as documented; a focused button or pressable no longer swallows them.
-- Pedro M. de Echanove Pasquin <pedro.echanove@liberux.net> Wed, 09 Sep 2026 12:00:00 +0200
ltk (0.3.0-1) unstable; urgency=low
* New upstream release: xdg-session-management-v1 client support (in-tree wayland-scanner bindings under protocols/), runtime session persistence in $XDG_STATE_HOME/<app_id>/ (session id, clean-exit marker, App::save_state bytes; saved periodically, on close and on SIGTERM/SIGINT), clean exit on signals.
* Breaking: App::app_id, App::save_state and App::restore_state are new mandatory trait methods; xdg_toplevel app_id and the AccessKit name now come from App::app_id.
-- Pedro M. de Echanove Pasquin <pedro.echanove@liberux.net> Sat, 15 Aug 2026 12:00:00 +0200
ltk (0.2.0-1) unstable; urgency=low
* New upstream release: embedder primitives for hosting an externally-laid-out widget tree (path/rect clipping, RGBA readback, standalone text measurement, CPU draw source, RichText).
-- Pedro M. de Echanove Pasquin <pedro.echanove@liberux.net> Thu, 25 Jun 2026 09:49:35 +0200
ltk (0.1.0-1) unstable; urgency=low
* Initial Debian packaging.
-- Pedro M. de Echanove Pasquin <pedro.echanove@liberux.net> Tue, 10 Mar 2026 00:00:00 +0200