From 991a18321be99369bb5bdd10586800a9d2aa34bc Mon Sep 17 00:00:00 2001 From: skylartaylor Date: Wed, 25 Nov 2026 23:56:00 +0100 Subject: [PATCH] The second trial checks the pointer move before the second right-click A menu shown in a popup window keeps the place its context opener hung it at while the pointer moves over that opener: the pointer the layer opened at is remembered, not taken again every pass. The trial now moves the pointer to the point it right-clicks next and requires the menu's window to stand where the first right-click put it, then right-clicks and requires the move. Without the layer's memory kept across passes, the popup's host took the pointer again in every pass, so the menu followed it there before any press. --- crates/ui-contract/tests/it/runtime/windows.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/ui-contract/tests/it/runtime/windows.rs b/crates/ui-contract/tests/it/runtime/windows.rs index c4df2c63e6..5dd64a9f42 100644 --- a/crates/ui-contract/tests/it/runtime/windows.rs +++ b/crates/ui-contract/tests/it/runtime/windows.rs @@ -629,8 +629,14 @@ fn a_second_right_click_hangs_a_menu_in_a_popup_window_at_the_new_pointer() { } assert!(closed.borrow().is_empty(), "the right-click opened the menu and closed nothing: {:?}", closed.borrow()); let opened = menu_window(&out); + // The pointer moves over the opener with no press: a menu that shows keeps the place its opener hung it at. + let out = frame(vec![moved(second)]); + let stayed = menu_window(&out); + assert!( + (stayed.min - opened.min).length() < 1.0, + "the menu stays where it opened while the pointer moves over its opener: it stood at {opened:?}, stands at {stayed:?}" + ); // A second right-click on the same opener, while the menu is open, hangs the menu at the new pointer. - frame(vec![moved(second)]); frame(vec![secondary(second, true)]); let mut out = frame(vec![secondary(second, false)]); for _ in 0..2 {