2014-06-06 19:07:38 +00:00
|
|
|
diff --git desktop_aura/desktop_root_window_host_win.cc desktop_aura/desktop_root_window_host_win.cc
|
|
|
|
index 938a05b..0a3184a 100644
|
|
|
|
--- desktop_aura/desktop_root_window_host_win.cc
|
|
|
|
+++ desktop_aura/desktop_root_window_host_win.cc
|
|
|
|
@@ -132,7 +132,9 @@ void DesktopRootWindowHostWin::Init(
|
2014-01-31 22:10:56 +00:00
|
|
|
native_widget_delegate_);
|
|
|
|
|
|
|
|
HWND parent_hwnd = NULL;
|
|
|
|
- if (params.parent && params.parent->GetDispatcher()) {
|
|
|
|
+ if (params.parent_widget) {
|
|
|
|
+ parent_hwnd = params.parent_widget;
|
|
|
|
+ } else if (params.parent && params.parent->GetDispatcher()) {
|
|
|
|
parent_hwnd =
|
|
|
|
params.parent->GetDispatcher()->host()->GetAcceleratedWidget();
|
|
|
|
}
|
2014-06-06 19:07:38 +00:00
|
|
|
@@ -757,7 +759,7 @@ void DesktopRootWindowHostWin::HandleAccelerator(
|
2014-01-31 22:10:56 +00:00
|
|
|
|
|
|
|
void DesktopRootWindowHostWin::HandleCreate() {
|
|
|
|
// TODO(beng): moar
|
|
|
|
- NOTIMPLEMENTED();
|
|
|
|
+ // NOTIMPLEMENTED();
|
|
|
|
|
|
|
|
native_widget_delegate_->OnNativeWidgetCreated(true);
|
|
|
|
|
2014-06-06 19:07:38 +00:00
|
|
|
@@ -822,6 +824,7 @@ void DesktopRootWindowHostWin::HandleFrameChanged() {
|
2014-04-04 22:27:32 +00:00
|
|
|
|
2014-06-06 19:07:38 +00:00
|
|
|
void DesktopRootWindowHostWin::HandleNativeFocus(HWND last_focused_window) {
|
|
|
|
// TODO(beng): inform the native_widget_delegate_.
|
|
|
|
+ GetWidget()->GetNativeWindow()->Focus();
|
|
|
|
InputMethod* input_method = GetInputMethod();
|
|
|
|
if (input_method)
|
|
|
|
input_method->OnFocus();
|
|
|
|
@@ -829,6 +832,7 @@ void DesktopRootWindowHostWin::HandleNativeFocus(HWND last_focused_window) {
|
|
|
|
|
|
|
|
void DesktopRootWindowHostWin::HandleNativeBlur(HWND focused_window) {
|
|
|
|
// TODO(beng): inform the native_widget_delegate_.
|
|
|
|
+ GetWidget()->GetNativeWindow()->Blur();
|
|
|
|
InputMethod* input_method = GetInputMethod();
|
|
|
|
if (input_method)
|
|
|
|
input_method->OnBlur();
|
|
|
|
diff --git desktop_aura/desktop_screen_win.cc desktop_aura/desktop_screen_win.cc
|
|
|
|
index 86823a0..1d3ebf0 100644
|
|
|
|
--- desktop_aura/desktop_screen_win.cc
|
|
|
|
+++ desktop_aura/desktop_screen_win.cc
|
|
|
|
@@ -54,6 +54,8 @@ gfx::Display DesktopScreenWin::GetDisplayMatching(
|
2014-01-31 22:10:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HWND DesktopScreenWin::GetHWNDFromNativeView(gfx::NativeView window) const {
|
|
|
|
+ if (!window)
|
|
|
|
+ return NULL;
|
|
|
|
aura::WindowEventDispatcher* dispatcher = window->GetDispatcher();
|
|
|
|
return dispatcher ? dispatcher->host()->GetAcceleratedWidget() : NULL;
|
|
|
|
}
|
2014-06-06 19:07:38 +00:00
|
|
|
diff --git widget.cc widget.cc
|
|
|
|
index b050ae6..f17bc8d 100644
|
|
|
|
--- widget.cc
|
|
|
|
+++ widget.cc
|
|
|
|
@@ -126,6 +126,7 @@ Widget::InitParams::InitParams()
|
2014-02-06 22:33:42 +00:00
|
|
|
show_state(ui::SHOW_STATE_DEFAULT),
|
|
|
|
double_buffer(false),
|
|
|
|
parent(NULL),
|
|
|
|
+ parent_widget(NULL),
|
|
|
|
native_widget(NULL),
|
|
|
|
desktop_root_window_host(NULL),
|
|
|
|
top_level(false),
|
2014-06-06 19:07:38 +00:00
|
|
|
@@ -153,6 +154,7 @@ Widget::InitParams::InitParams(Type type)
|
2014-02-06 23:36:48 +00:00
|
|
|
show_state(ui::SHOW_STATE_DEFAULT),
|
|
|
|
double_buffer(false),
|
|
|
|
parent(NULL),
|
|
|
|
+ parent_widget(NULL),
|
|
|
|
native_widget(NULL),
|
|
|
|
desktop_root_window_host(NULL),
|
|
|
|
top_level(false),
|
2014-06-06 19:07:38 +00:00
|
|
|
@@ -395,7 +397,12 @@ void Widget::Init(const InitParams& in_params) {
|
2014-03-12 14:37:11 +00:00
|
|
|
Minimize();
|
|
|
|
} else if (params.delegate) {
|
|
|
|
SetContentsView(params.delegate->GetContentsView());
|
|
|
|
- SetInitialBoundsForFramelessWindow(params.bounds);
|
|
|
|
+ if (params.parent_widget) {
|
|
|
|
+ // Set the bounds directly instead of applying an inset.
|
|
|
|
+ SetBounds(params.bounds);
|
|
|
|
+ } else {
|
|
|
|
+ SetInitialBoundsForFramelessWindow(params.bounds);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
native_widget_initialized_ = true;
|
|
|
|
}
|
2014-06-06 19:07:38 +00:00
|
|
|
diff --git widget.h widget.h
|
|
|
|
index ce14d7c..99c8063 100644
|
|
|
|
--- widget.h
|
|
|
|
+++ widget.h
|
|
|
|
@@ -201,6 +201,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
|
2014-01-31 22:10:56 +00:00
|
|
|
// Should the widget be double buffered? Default is false.
|
|
|
|
bool double_buffer;
|
|
|
|
gfx::NativeView parent;
|
|
|
|
+ gfx::AcceleratedWidget parent_widget;
|
|
|
|
// Specifies the initial bounds of the Widget. Default is empty, which means
|
|
|
|
// the NativeWidget may specify a default size. If the parent is specified,
|
|
|
|
// |bounds| is in the parent's coordinate system. If the parent is not
|