From 98f0c69a1cec9bd7c9f6cef076981b6f87f693ea Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 5 Nov 2026 00:27:44 -0800 Subject: [PATCH] Restore floating viewport pointer after wheel replay --- crates/ui-egui/src/font_menu.rs | 1 + crates/ui-egui/src/panel_docking/native_tests.rs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/crates/ui-egui/src/font_menu.rs b/crates/ui-egui/src/font_menu.rs index ffe326645..11a331e16 100644 --- a/crates/ui-egui/src/font_menu.rs +++ b/crates/ui-egui/src/font_menu.rs @@ -515,6 +515,7 @@ impl egui::Plugin for WheelLayerSnapshot { } } if fields.replay.len() > replayed { + fields.replay.push(fields.pointer.map_or(egui::Event::PointerGone, egui::Event::PointerMoved)); ctx.request_repaint(); } ctx.data_mut(|d| d.insert_temp(key, fields)); diff --git a/crates/ui-egui/src/panel_docking/native_tests.rs b/crates/ui-egui/src/panel_docking/native_tests.rs index 53b91e0ed..f4e195e4f 100644 --- a/crates/ui-egui/src/panel_docking/native_tests.rs +++ b/crates/ui-egui/src/panel_docking/native_tests.rs @@ -719,6 +719,7 @@ fn a_raised_overlay_blocks_the_next_font_wheel_event() { modifiers: Default::default(), source: egui::MouseWheelSource::Unknown, }, + Event::PointerGone, ]); h.frame(vec![]); let order = h.host.borrow().child_layer_order.get(&viewport).cloned().expect("child layer order"); @@ -733,6 +734,7 @@ fn a_raised_overlay_blocks_the_next_font_wheel_event() { "the raised overlay must receive the wheel event" ); assert_eq!(h.app.run("text.fonts", json!({})).unwrap(), before); + assert_eq!(h.ctx.input_for(viewport, |input| input.pointer.latest_pos()), None); } #[test] @@ -830,6 +832,7 @@ fn wheel_events_on_both_sides_of_an_overlay_are_checked_separately() { h.frame(vec![]); h.frame(vec![]); assert_ne!(h.app.run("text.fonts", json!({})).unwrap(), before); + assert_eq!(h.ctx.input_for(viewport, |input| input.pointer.latest_pos()), Some(clear)); } #[test]