fw sync: L-321: the merged middle autoscroll ends on the window's blur event

The port's latch ended on PassPointer::focus_lost and a PointerGone event; upstream's
MiddleAutoscroll read egui's focus flag only, which a blur event does not change in its
pass. The port's addition kept on top of upstream's autoscroll (L-321).
This commit is contained in:
Dylan M. Taylor committed 2026-11-23 02:42:50 -05:00
1 parent 6a7488ad73
commit ea9e4e3bea
1 file changed
+6 -1
+6 -1
View File
@@ -647,7 +647,12 @@ impl<'a> Canvas<'a> {
let moved = 'pass: {
if run.mark().is_some() {
let keyed = crate::runtime::keys::keyed(&ctx);
let unfocused = !ctx.input(|i| i.focused);
// The window's blur reaches the pass as its event (`PassPointer::focus_lost`) before egui's focus flag
// follows it, and a pointer gone from the window as its event: either ends the run in that pass.
let left = crate::runtime::pointer::with_pass_pointer(&ctx, |pointer| {
pointer.focus_lost || pointer.events.iter().any(|event| matches!(event, craft_behavior::PointerEvent::Gone))
});
let unfocused = left || !ctx.input(|i| i.focused);
let off = self.navigation.middle_button != MiddleButton::AutoScroll;
if keyed || ended || down || input.press.is_some() || unfocused || input.pos.is_none() || off {
// Escape only stops the scroll; any other key also does its own job.