From 10f3d9efad41a05476fb1357fd5d2f96d1e0d417 Mon Sep 17 00:00:00 2001 From: BFlat Date: Fri, 9 Oct 2026 06:13:47 +0700 Subject: [PATCH] Pipette cursor test: Windows draws the precise crosshair itself (#1437) input_tests::eyedropper_and_alt_sampling_show_a_pipette (#1028) expected the OS crosshair with Other Cursors = Precise, but on Windows the canvas draws its own crosshair and hides the OS cursor (visible_crosshair), so the test failed on every Windows run. Claude-Session: https://claude.ai/code/session_01UHgFEHEsefoQoBParH47JA Co-authored-by: Claude --- crates/ui-egui/src/input_tests.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/input_tests.rs b/crates/ui-egui/src/input_tests.rs index 8816027768..6f9b2a29fc 100644 --- a/crates/ui-egui/src/input_tests.rs +++ b/crates/ui-egui/src/input_tests.rs @@ -430,8 +430,10 @@ fn eyedropper_and_alt_sampling_show_a_pipette() { h.event(egui::Event::ModifiersChanged(Modifiers::ALT)); assert_eq!(cursor(&mut h), egui::CursorIcon::None, "⌥ samples with a pipette"); h.state_mut().run("prefs.set", json!({"values": {"cursors.other": "precise"}})).unwrap(); - assert_eq!(cursor(&mut h), egui::CursorIcon::Crosshair, "Precise keeps the crosshair"); + // Windows draws the crosshair on the canvas and hides the OS cursor (`visible_crosshair`). + let crosshair = if cfg!(target_os = "windows") { egui::CursorIcon::None } else { egui::CursorIcon::Crosshair }; + assert_eq!(cursor(&mut h), crosshair, "Precise keeps the crosshair"); h.event(egui::Event::ModifiersChanged(Modifiers::NONE)); h.state_mut().ui.tool = crate::state::Tool::Eyedropper; - assert_eq!(cursor(&mut h), egui::CursorIcon::Crosshair); + assert_eq!(cursor(&mut h), crosshair); }