Add mouse hover tracking across the Servo input pipeline
Without continuous MouseMove events, Servo never updates hover state: no cursor changes over links, no :hover CSS effects, no mouseenter JavaScript events. The web page appears completely non-interactive. Track mouse position from GPUI on_mouse_move through the full IPC pipeline to Servo. Hover position is included with each ensure request so Servo updates hover state at frame rate (~60fps).
This commit is contained in:
@@ -93,6 +93,8 @@ fn render_input_overlay(
|
||||
let click_tab_id = tab_id.clone();
|
||||
let click_url = url.clone();
|
||||
let click_entity = state_entity.clone();
|
||||
let hover_tab_id = tab_id.clone();
|
||||
let hover_entity = state_entity.clone();
|
||||
let scroll_tab_id = tab_id;
|
||||
let scroll_url = url;
|
||||
let scroll_entity = state_entity;
|
||||
@@ -116,6 +118,15 @@ fn render_input_overlay(
|
||||
});
|
||||
cx.stop_propagation();
|
||||
})
|
||||
.on_mouse_move(move |event, _window, cx| {
|
||||
hover_entity.update(cx, |shell, cx| {
|
||||
shell.hover_external_web_viewport(
|
||||
hover_tab_id.clone(),
|
||||
event.position,
|
||||
cx,
|
||||
);
|
||||
});
|
||||
})
|
||||
.on_scroll_wheel(move |event, window, cx| {
|
||||
let delta = event.delta.pixel_delta(window.line_height());
|
||||
scroll_entity.update(cx, |shell, cx| {
|
||||
|
||||
Reference in New Issue
Block a user