servo: Merge #10321 - compositing: Send only one mouse move event if WebRender is in use (from pcwalton:webrender-mouse-move); r=glennw
authorPatrick Walton <pcwalton@mimiga.net>
Sat, 02 Apr 2016 01:27:09 +0500
changeset 338383 fb6b6a657543480dfb6157732bfd6ad2b9a6f599
parent 338382 e7f64c3012ad02c76cb6e42fd2f2cb90475872ba
child 338384 729ff86b053ff04d197067887c26fdcbe76e1297
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglennw
servo: Merge #10321 - compositing: Send only one mouse move event if WebRender is in use (from pcwalton:webrender-mouse-move); r=glennw In WebRender mode, we were sending two mouse move events: one with the proper coordinates and one with the wrong coordinates, because of incorrect fall-through. The script task would usually (but not always, depending on timing) ignore the first event in favor of the second event, resulting in incorrect mouse move event coordinates in most cases. Closes servo/webrender#238. Closes #10298. r? @metajack Source-Repo: https://github.com/servo/servo Source-Revision: 0bf0f61a56eae3e3797c73847763e6c8b882d160
servo/components/compositing/compositor.rs
--- a/servo/components/compositing/compositor.rs
+++ b/servo/components/compositing/compositor.rs
@@ -1341,16 +1341,17 @@ impl<Window: WindowMethods> IOCompositor
 
             let translated_point =
                 webrender_api.translate_point_to_layer_space(&cursor.to_untyped());
             let event_to_send = MouseMoveEvent(Some(translated_point));
             root_pipeline.script_chan
                          .send(ConstellationControlMsg::SendEvent(root_pipeline_id,
                                                                   event_to_send))
                          .unwrap();
+            return
         }
 
         match self.find_topmost_layer_at_point(cursor / self.scene.scale) {
             Some(result) => {
                 // In the case that the mouse was previously over a different layer,
                 // that layer must update its state.
                 if let Some(last_pipeline_id) = self.last_mouse_move_recipient {
                     if last_pipeline_id != result.layer.pipeline_id() {