Skip to content

Commit

Permalink
fix: populate phase of WebMouseWheelEvents generated in webContents.s…
Browse files Browse the repository at this point in the history
…endInputEvent. (#18495)
  • Loading branch information
trop[bot] authored and codebytere committed May 30, 2019
1 parent 76414e5 commit 91bc35f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions atom/browser/api/atom_api_web_contents.cc
Expand Up @@ -1748,6 +1748,19 @@ void WebContents::SendInputEvent(v8::Isolate* isolate,
mouse_wheel_event);
#endif
} else {
// Chromium expects phase info in wheel events (and applies a
// DCHECK to verify it). See: https://crbug.com/756524.
mouse_wheel_event.phase = blink::WebMouseWheelEvent::kPhaseBegan;
mouse_wheel_event.dispatch_type = blink::WebInputEvent::kBlocking;
rwh->ForwardWheelEvent(mouse_wheel_event);

// Send a synthetic wheel event with phaseEnded to finish scrolling.
mouse_wheel_event.has_synthetic_phase = true;
mouse_wheel_event.delta_x = 0;
mouse_wheel_event.delta_y = 0;
mouse_wheel_event.phase = blink::WebMouseWheelEvent::kPhaseEnded;
mouse_wheel_event.dispatch_type =
blink::WebInputEvent::kEventNonBlocking;
rwh->ForwardWheelEvent(mouse_wheel_event);
}
return;
Expand Down

0 comments on commit 91bc35f

Please sign in to comment.