mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Properly set event.buttons value on mousemove
This commit is contained in:
parent
f7fb130a2a
commit
42ee1a86f6
3 changed files with 6 additions and 5 deletions
|
@ -779,11 +779,7 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
|
||||||
let results = self.hit_test_at_point(cursor);
|
let results = self.hit_test_at_point(cursor);
|
||||||
if let Some(item) = results.items.first() {
|
if let Some(item) = results.items.first() {
|
||||||
let node_address = Some(UntrustedNodeAddress(item.tag.0 as *const c_void));
|
let node_address = Some(UntrustedNodeAddress(item.tag.0 as *const c_void));
|
||||||
let event = MouseMoveEvent(
|
let event = MouseMoveEvent(Some(item.point_in_viewport.to_untyped()), node_address, 0);
|
||||||
Some(item.point_in_viewport.to_untyped()),
|
|
||||||
node_address,
|
|
||||||
MouseButton::Left as u16,
|
|
||||||
);
|
|
||||||
let pipeline_id = PipelineId::from_webrender(item.pipeline);
|
let pipeline_id = PipelineId::from_webrender(item.pipeline);
|
||||||
let msg = ConstellationMsg::ForwardEvent(pipeline_id, event);
|
let msg = ConstellationMsg::ForwardEvent(pipeline_id, event);
|
||||||
if let Err(e) = self.constellation_chan.send(msg) {
|
if let Err(e) = self.constellation_chan.send(msg) {
|
||||||
|
|
|
@ -2286,6 +2286,10 @@ where
|
||||||
_ => event,
|
_ => event,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if let MouseButtonEvent(MouseEventType::Click, ..) = event {
|
||||||
|
self.pressed_mouse_buttons = 0;
|
||||||
|
}
|
||||||
|
|
||||||
let msg = ConstellationControlMsg::SendEvent(destination_pipeline_id, event);
|
let msg = ConstellationControlMsg::SendEvent(destination_pipeline_id, event);
|
||||||
let result = match self.pipelines.get(&destination_pipeline_id) {
|
let result = match self.pipelines.get(&destination_pipeline_id) {
|
||||||
None => {
|
None => {
|
||||||
|
|
|
@ -159,6 +159,7 @@ void ServoControl::OnSurfacePointerMoved(
|
||||||
auto point = e.GetCurrentPoint(Panel());
|
auto point = e.GetCurrentPoint(Panel());
|
||||||
auto x = point.Position().X * mDPI;
|
auto x = point.Position().X * mDPI;
|
||||||
auto y = point.Position().Y * mDPI;
|
auto y = point.Position().Y * mDPI;
|
||||||
|
e.Handled(true);
|
||||||
RunOnGLThread([=] { mServo->MouseMove(x, y); });
|
RunOnGLThread([=] { mServo->MouseMove(x, y); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue