Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(567)

Unified Diff: content/browser/frame_host/render_widget_host_view_guest.cc

Issue 2174633003: Queued wheel events should not use ScopedInputScaleDisabler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/render_widget_host_view_guest.cc
diff --git a/content/browser/frame_host/render_widget_host_view_guest.cc b/content/browser/frame_host/render_widget_host_view_guest.cc
index b4557c27c130f456cc833aebd7921bff779e93dd..a3062e07efba7df3d7c42241d29faf6ff786b8cd 100644
--- a/content/browser/frame_host/render_widget_host_view_guest.cc
+++ b/content/browser/frame_host/render_widget_host_view_guest.cc
@@ -555,6 +555,24 @@ void RenderWidgetHostViewGuest::OnHandleInputEvent(
RenderWidgetHostImpl* embedder,
int browser_plugin_instance_id,
const blink::WebInputEvent* event) {
+ // WebMouseWheelEvents go into a queue, and may not be forwarded to the
+ // renderer until after this method goes out of scope. Therefore we need to
+ // explicitly remove the additional device scale factor from the coordinates
+ // before allowing the event to be queued.
+ if (IsUseZoomForDSFEnabled() &&
+ event->type == blink::WebInputEvent::MouseWheel) {
+ blink::WebMouseWheelEvent rescaled_event =
+ *static_cast<const blink::WebMouseWheelEvent*>(event);
+ rescaled_event.x /= current_device_scale_factor();
+ rescaled_event.y /= current_device_scale_factor();
+ rescaled_event.deltaX /= current_device_scale_factor();
+ rescaled_event.deltaY /= current_device_scale_factor();
+ rescaled_event.wheelTicksX /= current_device_scale_factor();
+ rescaled_event.wheelTicksY /= current_device_scale_factor();
+ host_->ForwardWheelEvent(rescaled_event);
+ return;
+ }
+
ScopedInputScaleDisabler disable(host_, current_device_scale_factor());
if (blink::WebInputEvent::isMouseEventType(event->type)) {
// The mouse events for BrowserPlugin are modified by all
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698