Symptom
In the GTK build, when there are multiple editor groups (e.g. Ctrl+\ to split right), the scroll wheel only scrolls the focused group. Hovering the mouse over a tab in the unfocused group and scrolling does nothing — you have to click into that group first.
The TUI build behaves correctly: hover over any window in any group and the wheel scrolls that window without changing focus or moving the cursor.
Cause
src/gtk/mod.rs:4048 (Msg::MouseScroll handler) calls engine.scroll_down_visible(...) / scroll_up_visible(...), which always operate on the active window's view. The TUI handler at src/tui_main/mouse.rs:1316 instead resolves the window under the cursor first and calls engine.scroll_*_visible_for_window(window_id, count).
The GTK scroll handler also has no access to the pointer position — Msg::MouseScroll { delta_x, delta_y } only carries deltas, not coordinates.
Fix
Two parts:
- Track the editor pointer position via a small
EventControllerMotion on the editor DrawingArea, storing (f64, f64) in an Rc<Cell<Option<(f64, f64)>>> field on App. Reset on connect_leave.
- In
Msg::MouseScroll, read the cached pointer, walk engine.calculate_group_window_rects(...) (same call pixel_to_click_target uses) to find the window under it, and call scroll_*_visible_for_window(window_id, count) when that window isn't the active one. Active window keeps its current cursor-clamp behaviour.
Acceptance
Symptom
In the GTK build, when there are multiple editor groups (e.g.
Ctrl+\to split right), the scroll wheel only scrolls the focused group. Hovering the mouse over a tab in the unfocused group and scrolling does nothing — you have to click into that group first.The TUI build behaves correctly: hover over any window in any group and the wheel scrolls that window without changing focus or moving the cursor.
Cause
src/gtk/mod.rs:4048(Msg::MouseScrollhandler) callsengine.scroll_down_visible(...)/scroll_up_visible(...), which always operate on the active window's view. The TUI handler atsrc/tui_main/mouse.rs:1316instead resolves the window under the cursor first and callsengine.scroll_*_visible_for_window(window_id, count).The GTK scroll handler also has no access to the pointer position —
Msg::MouseScroll { delta_x, delta_y }only carries deltas, not coordinates.Fix
Two parts:
EventControllerMotionon the editorDrawingArea, storing(f64, f64)in anRc<Cell<Option<(f64, f64)>>>field onApp. Reset onconnect_leave.Msg::MouseScroll, read the cached pointer, walkengine.calculate_group_window_rects(...)(same callpixel_to_click_targetuses) to find the window under it, and callscroll_*_visible_for_window(window_id, count)when that window isn't the active one. Active window keeps its current cursor-clamp behaviour.Acceptance
Ctrl+\), focus group A, hover the wheel over group B → group B scrollstui_main/mouse.rs)