diff options
author | Paul Rouget <me@paulrouget.com> | 2019-11-11 15:57:19 +0100 |
---|---|---|
committer | Paul Rouget <me@paulrouget.com> | 2019-11-11 16:00:44 +0100 |
commit | 42ee1a86f6b228fc7b6eb310fecd0a70fe95fb2a (patch) | |
tree | 1c5c25bb5f9ba278adb727200f3d6a70f285db8f | |
parent | f7fb130a2a21ae19cf0996251134ad23fea9068d (diff) | |
download | servo-42ee1a86f6b228fc7b6eb310fecd0a70fe95fb2a.tar.gz servo-42ee1a86f6b228fc7b6eb310fecd0a70fe95fb2a.zip |
Properly set event.buttons value on mousemove
-rw-r--r-- | components/compositing/compositor.rs | 6 | ||||
-rw-r--r-- | components/constellation/constellation.rs | 4 | ||||
-rw-r--r-- | support/hololens/ServoApp/ServoControl/ServoControl.cpp | 1 |
3 files changed, 6 insertions, 5 deletions
diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 3df7e1a8a0c..abfcf6b1aa1 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -779,11 +779,7 @@ 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, - MouseButton::Left as u16, - ); + let event = MouseMoveEvent(Some(item.point_in_viewport.to_untyped()), node_address, 0); let pipeline_id = PipelineId::from_webrender(item.pipeline); let msg = ConstellationMsg::ForwardEvent(pipeline_id, event); if let Err(e) = self.constellation_chan.send(msg) { diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs index 807495ff3f1..ce71f25c324 100644 --- a/components/constellation/constellation.rs +++ b/components/constellation/constellation.rs @@ -2286,6 +2286,10 @@ where _ => event, }; + if let MouseButtonEvent(MouseEventType::Click, ..) = event { + self.pressed_mouse_buttons = 0; + } + let msg = ConstellationControlMsg::SendEvent(destination_pipeline_id, event); let result = match self.pipelines.get(&destination_pipeline_id) { None => { diff --git a/support/hololens/ServoApp/ServoControl/ServoControl.cpp b/support/hololens/ServoApp/ServoControl/ServoControl.cpp index c0a5ee26f8f..5aefe85b813 100644 --- a/support/hololens/ServoApp/ServoControl/ServoControl.cpp +++ b/support/hololens/ServoApp/ServoControl/ServoControl.cpp @@ -159,6 +159,7 @@ void ServoControl::OnSurfacePointerMoved( auto point = e.GetCurrentPoint(Panel()); auto x = point.Position().X * mDPI; auto y = point.Position().Y * mDPI; + e.Handled(true); RunOnGLThread([=] { mServo->MouseMove(x, y); }); } } |