Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: populate phase of WebMouseWheelEvents in webContents.sendInputEvent #18495

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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