mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Fix routing of OSR input events inside iframes (fixes issue #2789)
Mouse events need to be routed to the correct view and CefRenderWidgetHostViewOSR::TransformPointToCoordSpaceForView needs to be properly implemented for RenderWidgetHostInputEventRouter::DispatchTouchscreenGestureEvent to transform event position in the target widget.
This commit is contained in:
committed by
Marshall Greenblatt
parent
7653e9e04c
commit
0f944cdc55
@ -851,7 +851,8 @@ bool CefRenderWidgetHostViewOSR::TransformPointToCoordSpaceForView(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return target_view->TransformPointToLocalCoordSpace(
|
||||||
|
point, GetCurrentSurfaceId(), transformed_point);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefRenderWidgetHostViewOSR::DidNavigate() {
|
void CefRenderWidgetHostViewOSR::DidNavigate() {
|
||||||
@ -1021,10 +1022,18 @@ void CefRenderWidgetHostViewOSR::SendMouseEvent(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (render_widget_host_ && render_widget_host_->GetView()) {
|
if (render_widget_host_ && render_widget_host_->GetView()) {
|
||||||
// Direct routing requires that mouse events go directly to the View.
|
if (ShouldRouteEvents()) {
|
||||||
|
// RouteMouseEvent wants non-const pointer to WebMouseEvent, but it only
|
||||||
|
// forwards it to RenderWidgetTargeter::FindTargetAndDispatch as a const
|
||||||
|
// reference, so const_cast here is safe.
|
||||||
|
render_widget_host_->delegate()->GetInputEventRouter()->RouteMouseEvent(
|
||||||
|
this, const_cast<blink::WebMouseEvent*>(&event),
|
||||||
|
ui::LatencyInfo(ui::SourceEventType::OTHER));
|
||||||
|
} else {
|
||||||
render_widget_host_->GetView()->ProcessMouseEvent(
|
render_widget_host_->GetView()->ProcessMouseEvent(
|
||||||
event, ui::LatencyInfo(ui::SourceEventType::OTHER));
|
event, ui::LatencyInfo(ui::SourceEventType::OTHER));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefRenderWidgetHostViewOSR::SendMouseWheelEvent(
|
void CefRenderWidgetHostViewOSR::SendMouseWheelEvent(
|
||||||
@ -1092,10 +1101,17 @@ void CefRenderWidgetHostViewOSR::SendMouseWheelEvent(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (render_widget_host_ && render_widget_host_->GetView()) {
|
if (render_widget_host_ && render_widget_host_->GetView()) {
|
||||||
// Direct routing requires that mouse events go directly to the View.
|
if (ShouldRouteEvents()) {
|
||||||
|
render_widget_host_->delegate()
|
||||||
|
->GetInputEventRouter()
|
||||||
|
->RouteMouseWheelEvent(
|
||||||
|
this, const_cast<blink::WebMouseWheelEvent*>(&mouse_wheel_event),
|
||||||
|
ui::LatencyInfo(ui::SourceEventType::WHEEL));
|
||||||
|
} else {
|
||||||
render_widget_host_->GetView()->ProcessMouseWheelEvent(
|
render_widget_host_->GetView()->ProcessMouseWheelEvent(
|
||||||
mouse_wheel_event, ui::LatencyInfo(ui::SourceEventType::WHEEL));
|
mouse_wheel_event, ui::LatencyInfo(ui::SourceEventType::WHEEL));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefRenderWidgetHostViewOSR::SendTouchEvent(const CefTouchEvent& event) {
|
void CefRenderWidgetHostViewOSR::SendTouchEvent(const CefTouchEvent& event) {
|
||||||
|
Reference in New Issue
Block a user