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

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2807433003: No pointer captured when the pointer lock is applied (Closed)
Patch Set: pointer lock Created 3 years, 7 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
Index: third_party/WebKit/Source/web/WebViewImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index 32bfe0a1f7bd6404309540f6d3822ce589191ca1..0e87efe1df348dd8649c23cea6adafbaab22bb2b 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -2191,6 +2191,19 @@ WebInputEventResult WebViewImpl::HandleInputEvent(
if (is_pointer_locked &&
WebInputEvent::IsMouseEventType(input_event.GetType())) {
MainFrameImpl()->FrameWidget()->PointerLockMouseEvent(input_event);
+ LocalFrame* focusedFrame = FocusedLocalFrameInWidget();
+
+ if (focusedFrame) {
+ WebMouseEvent transformed_event = TransformWebMouseEvent(
+ MainFrameImpl()->GetFrameView(),
+ static_cast<const WebMouseEvent&>(input_event));
+ Vector<WebMouseEvent> transformed_coalesced_events =
+ TransformWebMouseEventVector(
+ MainFrameImpl()->GetFrameView(),
+ coalesced_event.GetCoalescedEventsPointers());
+ focusedFrame->GetEventHandler().DispatchLostPointerCaptureEvent(
Navid Zolghadr 2017/05/17 16:30:11 This doesn't seem correct. We should have called P
+ transformed_event, transformed_coalesced_events);
+ }
return WebInputEventResult::kHandledSystem;
}
@@ -2279,6 +2292,11 @@ void WebViewImpl::SetCursorVisibilityState(bool is_visible) {
void WebViewImpl::MouseCaptureLost() {
TRACE_EVENT_ASYNC_END0("input", "capturing mouse", this);
mouse_capture_node_ = nullptr;
+
+ LocalFrame* focusedFrame = FocusedLocalFrameInWidget();
+
+ if (focusedFrame)
+ focusedFrame->GetEventHandler().ReleaseMousePointerCapture();
Navid Zolghadr 2017/05/17 16:30:11 Why do we need to release mouse capture when captu
lanwei 2017/05/19 15:05:00 This is for the case that we call the setPointerCa
}
void WebViewImpl::SetFocus(bool enable) {

Powered by Google App Engine
This is Rietveld 408576698