Windows: Fix focus/activation handling and keyboard input (issue #1700)

This commit is contained in:
Marshall Greenblatt
2015-08-27 17:55:48 -04:00
parent c2086cf7c7
commit 4a8546efd7
5 changed files with 52 additions and 50 deletions

View File

@@ -41,6 +41,13 @@ void CefWindowDelegateView::Init(
params.opacity = views::Widget::InitParams::OPAQUE_WINDOW;
// Tell Aura not to draw the window frame on resize.
params.remove_standard_frame = true;
#if defined(OS_WIN)
// Cause WidgetDelegate::CanActivate to return true. See comments in
// CefBrowserHostImpl::PlatformSetFocus.
// TODO(cef): Do we need similar logic on Linux for proper activation/focus
// handling?
params.activatable = views::Widget::InitParams::ACTIVATABLE_YES;
#endif
// Results in a call to InitContent().
widget->Init(params);
@@ -49,6 +56,10 @@ void CefWindowDelegateView::Init(
DCHECK_EQ(widget, GetWidget());
// |widget| must be top-level for focus handling to work correctly.
DCHECK(widget->is_top_level());
#if defined(OS_WIN)
// |widget| must be activatable for focus handling to work correctly.
DCHECK(widget->widget_delegate()->CanActivate());
#endif
}
void CefWindowDelegateView::InitContent() {