From 5488eb4d4c87852556b14d04319467df700f20cb Mon Sep 17 00:00:00 2001 From: hnoerenberg Date: Sat, 28 Nov 2026 13:23:51 +0100 Subject: [PATCH] fix(control): check the picker gesture guard on the driven canvas The sampling guard named the active document's main canvas while the queueing route drives the canvas this request picked (the top dialog's own, else the main one). Read the gesture state on that same canvas: ToolHost::in_gesture (ctx, canvas) in place of canvas::tools::in_gesture(app). With a Color Picker as the top dialog its declared canvas is the one the events would drive, so the two reads answer the same today and every existing guard stays green; the guard now states what it means. --- crates/ui-egui/src/control/dispatch.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/src/control/dispatch.rs b/crates/ui-egui/src/control/dispatch.rs index f85291437fc..1d6384aab20 100644 --- a/crates/ui-egui/src/control/dispatch.rs +++ b/crates/ui-egui/src/control/dispatch.rs @@ -1261,7 +1261,7 @@ fn pointer(app: &mut PhotocraftApp, ctx: &egui::Context, p: &Value) -> Reply { // over the canvas, so the picker's own controls would take the synthetic events as clicks. A gesture // the canvas is already running keeps its tool to its release (the picker's pick begins at the next press). if button == PointerButton::Primary - && !crate::canvas::tools::in_gesture(app) + && !ToolHost::in_gesture(ctx, canvas) && crate::dialogs::canvas_input::armed(app) == Some(crate::dialogs::canvas_input::DialogPick::Color) { let mut held = false;