From 7842ca5574729295c5798237a9df8c99772dd5f9 Mon Sep 17 00:00:00 2001 From: skylartaylor Date: Wed, 25 Nov 2026 19:46:19 +0100 Subject: [PATCH] Correct the trial's comment on the recorded press The pass records the press outside the zone it begins with, which the second menu still set in the pass it closed; the menu need not stand when the press is made. Says that, and that the record is judged against the menus the pass before showed. --- crates/ui-widgets/tests/it/menu/openers.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/ui-widgets/tests/it/menu/openers.rs b/crates/ui-widgets/tests/it/menu/openers.rs index a60c2e4a90..65a90f7ec3 100644 --- a/crates/ui-widgets/tests/it/menu/openers.rs +++ b/crates/ui-widgets/tests/it/menu/openers.rs @@ -128,8 +128,8 @@ fn a_new_right_click_moves_an_open_context_menu_to_the_pointer() { /// A right-click on a second opener while a menu is open closes that menu and opens the second one, as it does on the /// opener of a closed one: the press lay outside the menu it closed, not outside the menu it opened. A press is judged -/// against the menus open when it was recorded, so a menu that appears in that same pass, after the record, is not -/// dismissed by it. +/// against the menus the pass before it showed: one that appears in the press's own pass comes after that record, and +/// the press is not outside it. #[trial] fn a_right_click_on_a_second_opener_closes_the_open_menu_and_opens_its_own() { const FIRST: Rect = Rect { min: Pos2::new(8.0, 8.0), max: Pos2::new(200.0, 32.0) }; @@ -156,8 +156,9 @@ fn a_right_click_on_a_second_opener_closes_the_open_menu_and_opens_its_own() { assert!(fixture.by_label("Second action").is_some(), "the right-click on the second target opens its menu"); assert!(fixture.by_label("First action").is_none(), "the first menu closed"); // A press in the pass a menu appears in: a double right-click on the first target, its second press in the frame of - // the release that opens the first menu. That press is the frame's one press, recorded while the second menu stands; - // the first menu appears in that same pass, after the record was made, and the press is not outside it. + // the release that opens the first menu. That press is the frame's one press, and it lands outside the zone the + // frame begins with, which the second menu still set in the pass it closed, so the pass records it. The first menu + // appears in that same pass, after the record was made, and the record is not for it. fixture.frame(vec![pointer::moved(first)]).frame(vec![pointer::secondary(first, true)]); fixture.frame(vec![pointer::secondary(first, false), pointer::secondary(first, true)]).settle(); assert!(fixture.by_label("First action").is_some(), "the press recorded in the pass the first menu appears in does not close it");