From 5fbc43482931a34d22b849444aab2bcdb175fcd6 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 05:35:10 +0000 Subject: [PATCH] Pipette cursor test: Windows reports the precise crosshair with its bitmap (#1160) test (windows-latest) fails on main in input_tests::eyedropper_and_alt_sampling_show_a_pipette ("Precise keeps the crosshair": left Crosshair, right None). #1437 expected None on Windows because the canvas drew the crosshair and hid the OS cursor; since #1160 Windows hands the OS a bitmap cursor and tool_cursor's end-of-pass hook reports Crosshair underneath it. The test now expects Crosshair everywhere, plus the bitmap on Windows. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01UHgFEHEsefoQoBParH47JA (cherry picked from commit 32657d5b262a0aa0d4dc1eead8614463d67df920) --- crates/ui-egui/src/input_tests.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/crates/ui-egui/src/input_tests.rs b/crates/ui-egui/src/input_tests.rs index b2df7b1bdb..eb20783dac 100644 --- a/crates/ui-egui/src/input_tests.rs +++ b/crates/ui-egui/src/input_tests.rs @@ -488,10 +488,15 @@ 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(); - // 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"); + // Every platform reports the crosshair. Windows also hands the OS a black-and-white bitmap + // for it (`tool_cursor`, #1160), with `Crosshair` underneath as the fallback. + let precise = |h: &mut Harness<'static, PhotocraftApp>| { + let icon = cursor(h); + (icon, h.output().platform_output.cursor_image.is_some()) + }; + let windows = cfg!(target_os = "windows"); + assert_eq!(precise(&mut h), (egui::CursorIcon::Crosshair, windows), "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), crosshair); + assert_eq!(precise(&mut h), (egui::CursorIcon::Crosshair, windows)); }