Commit 3fa4927a authored by Christopher Cameron's avatar Christopher Cameron Committed by Commit Bot

Elide redundant Focus calls

This was the result of an infinite loop wherein
- RWHVMac::OnFirstResponderChanged(true) would eventually call
- (bunch of views::Views stuff)
- RWHVMac::Focus()
- Making the RWHVCocoa first responder, calling
- RWHVMac::OnFirstResponderChanged(true)

Early-out of redundant calls to RWHVMac::Focus, to break this loop.

Bug: 998123
Change-Id: Iacf9abb6b03c07d11bd1168a7d9d7459a69fc554
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1848893Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704986}
parent a5782299
......@@ -507,6 +507,10 @@ gfx::NativeViewAccessible RenderWidgetHostViewMac::GetNativeViewAccessible() {
}
void RenderWidgetHostViewMac::Focus() {
// Ignore redundant calls, as they can cause unending loops of focus-setting.
// https://crbug.com/998123
if (is_first_responder_)
return;
ns_view_->MakeFirstResponder();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment