From 4a406a6cf688b1296d66d98324728c5aed582e94 Mon Sep 17 00:00:00 2001 From: BFlat Date: Fri, 9 Oct 2026 13:23:57 +0700 Subject: [PATCH] Pipette cursor test: Windows reports the precise crosshair with its bitmap (Windows CI red since #1160) (#1626) * 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 * i18n(el): translate "Pick a screen pixel or press Esc to cancel" The last screen color picker string #1618 missed: xtask's source_key_set_is_covered_by_complete_catalogs still fails on main for el. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01UHgFEHEsefoQoBParH47JA (cherry picked from commit 14ed88e39904f2b173aae196a5e9e2d4af128940) --------- Co-authored-by: Claude --- 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 b2df7b1bdb3..eb20783dacb 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)); }