From d2d459feebcde30b70125269c66daaeb4d3d8365 Mon Sep 17 00:00:00 2001 From: zhom <2717306+zhom@users.noreply.github.com> Date: Sun, 15 Mar 2026 19:58:51 +0400 Subject: [PATCH] fix: better scroll handling --- src-tauri/src/synchronizer.rs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src-tauri/src/synchronizer.rs b/src-tauri/src/synchronizer.rs index 7072d87..7de687d 100644 --- a/src-tauri/src/synchronizer.rs +++ b/src-tauri/src/synchronizer.rs @@ -795,17 +795,16 @@ impl SynchronizerManager { )) } } - "wheel" => Some(( - "Input.dispatchMouseEvent", - serde_json::json!({ - "type": "mouseWheel", - "x": event.x.unwrap_or(0.0), - "y": event.y.unwrap_or(0.0), - "deltaX": -event.delta_x.unwrap_or(0.0), - "deltaY": -event.delta_y.unwrap_or(0.0), - "modifiers": event.modifiers.unwrap_or(0), - }), - )), + "wheel" => { + let dx = -event.delta_x.unwrap_or(0.0); + let dy = -event.delta_y.unwrap_or(0.0); + Some(( + "Runtime.evaluate", + serde_json::json!({ + "expression": format!("window.scrollBy({dx},{dy})"), + }), + )) + } _ => None, };