Commit f0c947d9 authored by asanka@chromium.org's avatar asanka@chromium.org

Keep visibility state in sync between the native window and view

Native ConstrainedWindows are invisible upon creation on Windows.  Mark the
associated NonClientView as hidden to keep the visibility state in sync.

BUG=69673
TEST=none

Review URL: http://codereview.chromium.org/6261015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71999 0039d316-1c4b-4281-b951-d872f2087c98
parent 2c5d7358
...@@ -571,6 +571,9 @@ void ConstrainedWindowWin::FocusConstrainedWindow() { ...@@ -571,6 +571,9 @@ void ConstrainedWindowWin::FocusConstrainedWindow() {
} }
void ConstrainedWindowWin::ShowConstrainedWindow() { void ConstrainedWindowWin::ShowConstrainedWindow() {
// We marked the view as hidden during construction. Mark it as
// visible now so FocusManager will let us receive focus.
GetNonClientView()->SetVisible(true);
if (owner_->delegate()) if (owner_->delegate())
owner_->delegate()->WillShowConstrainedWindow(owner_); owner_->delegate()->WillShowConstrainedWindow(owner_);
ActivateConstrainedWindow(); ActivateConstrainedWindow();
...@@ -614,6 +617,10 @@ ConstrainedWindowWin::ConstrainedWindowWin( ...@@ -614,6 +617,10 @@ ConstrainedWindowWin::ConstrainedWindowWin(
set_window_style(WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | set_window_style(WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION |
WS_THICKFRAME | WS_SYSMENU); WS_THICKFRAME | WS_SYSMENU);
set_focus_on_creation(false); set_focus_on_creation(false);
// Views default to visible. Since we are creating a window that is
// not visible (no WS_VISIBLE), mark our View as hidden so that
// FocusManager can deal with it properly.
GetNonClientView()->SetVisible(false);
WindowWin::Init(owner_->GetNativeView(), gfx::Rect()); WindowWin::Init(owner_->GetNativeView(), gfx::Rect());
} }
......
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