Second attempt at fixing pointer lock issues with Windows HiDPI.
The earlier attempt https://codereview.chromium.org/973123003/ was incorrect. Reverted parts that patch
which changed the WebMouseEventBuilder::Build function to convert from DIP to pixels and back. The initial
conversion from DIP to pixels was not needed as the values are picked up from the Windows message which gives
us these coordinates in pixels.
Changes in this patch are as below:-
1. The WebMouseEventBuilder::Build function has been changed to convert the WebMouseEvent::globalX and globalY values
to DIP. The other changes in the earlier patch as mentioned above have been reverted.
2. The RenderWidgetHostViewAura::UpdateMouseLockRegion function which executes on Windows was clipping the windows cursor
to a rectangle in DIPs. We need to convert this rectangle to pixels before calling the ClipCursor API. This was the
main reason for the lock operation not working correctly.
3. I was seeing a DCHECK in the renderer process in the WebViewImpl::pointerLockMouseEvent function as we were sending
the mouse leave message. Added code in the CanRendererHandleEvent function in the render_widget_host_view_aura.cc file
to not send this message if we are in the mouse locked state.
BUG=411634
TEST= The main test case in bug 411634
Review URL: https://codereview.chromium.org/981393002
Cr-Commit-Position: refs/heads/master@{#319791}
5 files changed