Implement MouseEvent buttons attribute

This commit is contained in:
George Roman 2019-04-22 16:53:17 +03:00
parent 425686984d
commit be3cb00c77
10 changed files with 111 additions and 36 deletions

View file

@ -662,6 +662,7 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
result.point_in_viewport.to_untyped(),
Some(UntrustedNodeAddress(result.tag.0 as *const c_void)),
Some(result.point_relative_to_item.to_untyped()),
MouseButton::Left as u16,
);
let pipeline_id = PipelineId::from_webrender(result.pipeline);
@ -705,7 +706,11 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
let results = self.hit_test_at_point(cursor);
if let Some(item) = results.items.first() {
let node_address = Some(UntrustedNodeAddress(item.tag.0 as *const c_void));
let event = MouseMoveEvent(Some(item.point_in_viewport.to_untyped()), node_address);
let event = MouseMoveEvent(
Some(item.point_in_viewport.to_untyped()),
node_address,
MouseButton::Left as u16,
);
let pipeline_id = PipelineId::from_webrender(item.pipeline);
let msg = ConstellationMsg::ForwardEvent(pipeline_id, event);
if let Err(e) = self.constellation_chan.send(msg) {