Skip to content

List selection visible on every backend; win32 layout propagates up, canvases grow, pickers report their selection - #174

Merged
nicolas-maman merged 2 commits into
mainfrom
fix/win32-layout-propagates-up
Sep 19, 2026
Merged

nicolas-maman merged 2 commits into
mainfrom
fix/win32-layout-propagates-up

Conversation

@nicolas-maman

Copy link
Copy Markdown
Contributor

Four defects found by looking at the screens on Windows, three of them with a cross-backend angle.

A selected list row is visible on every backend

.aui-row-selected was painted by GTK4's stylesheet and, on AppKit, Win32 and UIKit, only reported to the driver: a listbox's selection could be read by a spec and not seen by a user. Each backend now paints its system's selection tint over the row's own ground and takes it off when the class leaves:

  • Win32: the user's accent as a tint the labels stay legible on (w32_selection_ground: a quarter over white on a light system, a good third over the dark ground on a dark one), through w32_own_ground so WM_CTLCOLORSTATIC gives the labels the legible text colour automatically;
  • AppKit: unemphasizedSelectedContentBackgroundColor in aeui_apply_state_bg (keeps the app's label colours legible in both appearances);
  • UIKit: tertiarySystemFillColor, the row's own colour kept and restored.

win32 lays the containers above a changed stack out again

A child added to a nested stack (a listbox's rows go into the each container inside the app's column) changes that stack's natural size, and the column has to place what follows it lower. The layout request stopped at the nested stack: the column kept the container at the height it had when empty, and 200 rows were drawn over the buttons under it (listbox_demo after "Add 200"). w32_request_layout now climbs to every container whose size can change, stopping after a scrollview or a stack pinned in height — the bounds set_hidden's synchronous climb already used. rebuild_bench unchanged (0.88–0.95s on screen, 0.63–0.67s headless).

win32: a canvas grows with its window, and on_resize fires

canvas_create's width and height are the natural size on GTK4 (expand past content size) and AppKit (priority 150); win32 stored them as the pin width()/height()/canvas_size set, so a canvas created 80×80 stayed 80×80 in a 700px window and canvas_on_resize never fired. The natural size is the measure's answer now; a pin is still a pin. tests/resizecb_demo passes on Windows (it was on the "known local failures" list — it was a bug).

win32: a picker's text is its selection; a programmatic selection fires on_change

The driver's text for a picker was always empty (a combo box has no window text to cache); the selected item is cached after every change. CB_SETCURSEL sends no CBN_SELCHANGE, so picker_set_selected invokes the closure itself when the index changed, as GTK4, AppKit and UIKit do. tests/picker passes on Windows (also on the known-failures list — also a bug).

Verified natively

Runtime test; 74 headless specs against main (the remaining local failures — gpuview_demo, tumbling_cube, vg_tooltip — are the GL-less headless run and the AETHER_UI_CHROME/AETHER_UI_TOOLTIP env gates ci.sh sets, not defects); 21 canvas specs; captures of listbox_demo with rows added (buttons back below the list) and a row selected, then moved with Down (the highlight follows).

…iners above a changed stack out again

.aui-row-selected was painted by GTK4's stylesheet and, on AppKit, Win32
and UIKit, only reported to the driver: a listbox's selection could be
read by a spec and not seen by a user. Each backend now paints its
system's selection tint over the row's own ground (Win32 the accent as a
tint the labels stay legible on, AppKit
unemphasizedSelectedContentBackgroundColor, UIKit tertiarySystemFill) and
takes it off when the class leaves.

On win32 a child added to a nested stack (a listbox's rows go into the
each container inside the app's column) changed that stack's natural size
and nothing above it was laid out again: the column kept the container at
the height it had when empty and 200 rows were drawn over the buttons
under it. w32_request_layout climbs to every container whose size can
change, stopping after a scrollview or a stack pinned in height, the
bounds set_hidden's synchronous climb already used.

Verified natively: runtime test, 74 headless specs unchanged against
main, rebuild_bench unchanged, captures of listbox_demo with rows added
and a row selected, then moved with Down.
canvas_create's width and height are the canvas's natural size on every
backend; win32 stored them as the pin width()/height()/canvas_size set,
so a canvas created 80x80 stayed 80x80 in a 700px window and
canvas_on_resize never fired. The natural size is the measure's answer
now (w32_canvas_natural); a pin is still a pin. tests/resizecb_demo
passes on Windows.

The driver's text for a picker was always empty, a combo box having no
window text to cache; the selected item is cached after every change of
selection. CB_SETCURSEL sends no CBN_SELCHANGE, so picker_set_selected
invokes on_change itself when the index changed, as the other backends
do. tests/picker passes on Windows.

21 canvas specs and the binding specs pass headless.
@nicolas-maman
nicolas-maman merged commit 287b104 into main Sep 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant