Preserve native focus sequencing in delayed-owner regression

This commit is contained in:
2026-09-12 05:37:27 -07:00
parent c3c2d01453
commit 42511f0f8a
11 changed files with 6333 additions and 7 deletions
@@ -596,6 +596,17 @@ async fn production_canvas_keyboard_and_delayed_tasks_respect_real_chooser_and_r
let snapshot = app.document.snapshot();
let raw = serde_json::to_value(app.draft.as_ref().unwrap().recovery_snapshot()).unwrap();
let mut retained_apply = retained_focus_apply(&mut mounted, &mut app).await;
assert!(
mounted
.input(&app, &[key(Named::F6)], mouse::Cursor::Unavailable)
.is_empty(),
"a second F6 cannot enter while the first focus operation is pending"
);
// Native Iced completes the Chain synchronously. Complete it before a new
// keyboard request, retaining the same Apply to challenge its ownership
// guard again after it has already observed a valid owner.
mounted.operate(&app, &mut *retained_apply);
assert!(focused(&mut mounted, &app, "viewport"));
let entry = mounted.input(&app, &[key(Named::F6)], mouse::Cursor::Unavailable);
assert_eq!(entry.len(), 1);
let delayed = app.update(entry[0].clone());
@@ -705,6 +716,8 @@ async fn production_canvas_keyboard_and_delayed_tasks_respect_real_chooser_and_r
);
let mut retained_apply = retained_focus_apply(&mut mounted, &mut app).await;
mounted.operate(&app, &mut *retained_apply);
assert!(focused(&mut mounted, &app, "viewport"));
let entry = mounted.input(&app, &[key(Named::F6)], mouse::Cursor::Unavailable);
let delayed = app.update(
entry