From 2ea95c8813c34f016fa2fd34ab7df42f7585e736 Mon Sep 17 00:00:00 2001 From: Abdelrahman Hossam <43494928+abdelrahman1234567@users.noreply.github.com> Date: Wed, 16 Jul 2025 14:53:55 +0800 Subject: [PATCH] servoshell: Send all button events to the `WebView` regardless of what button is pressed (#38053) Sending all mouse button events (Left, Right, Middle, Back, Forward) to the constellation for processing. Before, only left and right mouse buttons were handled. Testing: There is no new test for this. Manually testing was done. We currently do not have a good way to test user interaction in servoshell. Fixes: #37996 Signed-off-by: abdelrahman1234567 --- ports/servoshell/desktop/headed_window.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ports/servoshell/desktop/headed_window.rs b/ports/servoshell/desktop/headed_window.rs index 4cd0c582f10..739fd9fdc75 100644 --- a/ports/servoshell/desktop/headed_window.rs +++ b/ports/servoshell/desktop/headed_window.rs @@ -594,9 +594,7 @@ impl WindowPortsMethods for Window { WindowEvent::KeyboardInput { event, .. } => self.handle_keyboard_input(state, event), WindowEvent::ModifiersChanged(modifiers) => self.modifiers_state.set(modifiers.state()), WindowEvent::MouseInput { state, button, .. } => { - if button == MouseButton::Left || button == MouseButton::Right { - self.handle_mouse(&webview, button, state); - } + self.handle_mouse(&webview, button, state); }, WindowEvent::CursorMoved { position, .. } => { let mut point = winit_position_to_euclid_point(position).to_f32();