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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 1317163003: Fix a mouse lock problem on Windows where in clicks outside the web page would also cause mouse loc… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 4 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/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 8d3df3bd923206398feeb86662585936116c3336..dad412a0444d651d3e3c4ad8a116d5508f6584ad 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -345,12 +345,9 @@ void RenderWidgetHostViewAura::ApplyEventFilterForPopupExit(
// If we enter this code path it means that we did not receive any focus
// lost notifications for the popup window. Ensure that blink is aware
// of the fact that focus was lost for the host window by sending a Blur
- // notification. We also set a flag in the view indicating that we need
- // to force a Focus notification on the next mouse down.
- if (popup_parent_host_view_ && popup_parent_host_view_->host_) {
- popup_parent_host_view_->set_focus_on_mouse_down_ = true;
+ // notification.
+ if (popup_parent_host_view_ && popup_parent_host_view_->host_)
popup_parent_host_view_->host_->Blur();
- }
// Note: popup_parent_host_view_ may be NULL when there are multiple
// popup children per view. See: RenderWidgetHostViewAura::InitAsPopup().
Shutdown();
@@ -472,7 +469,6 @@ RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host,
has_snapped_to_boundary_(false),
is_guest_view_hack_(is_guest_view_hack),
begin_frame_observer_proxy_(this),
- set_focus_on_mouse_down_(false),
weak_ptr_factory_(this) {
if (!is_guest_view_hack_)
host_->SetView(this);
@@ -748,10 +744,6 @@ void RenderWidgetHostViewAura::SetKeyboardFocus() {
::SetFocus(host->GetAcceleratedWidget());
}
#endif
- if (host_ && set_focus_on_mouse_down_) {
- set_focus_on_mouse_down_ = false;
- host_->Focus();
- }
}
RenderFrameHostImpl* RenderWidgetHostViewAura::GetFocusedFrame() {
@@ -1522,11 +1514,13 @@ void RenderWidgetHostViewAura::UnlockMouse() {
mouse_locked_ = false;
-#if !defined(OS_WIN)
- window_->ReleaseCapture();
-#else
+ if (window_->HasCapture())
+ window_->ReleaseCapture();
+
+#if defined(OS_WIN)
::ClipCursor(NULL);
#endif
+
window_->MoveCursorTo(unlocked_mouse_position_);
aura::client::CursorClient* cursor_client =
aura::client::GetCursorClient(root_window);
« 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