Commit 0453d0de authored by ananta@chromium.org's avatar ananta@chromium.org

We need to call aura::Window::Show from the...

We need to call aura::Window::Show from the DesktopNativeWidgetAura::ShowMaximizedWithBounds and ShowWithWindowState functions.

This is specifically important if the underlying Widget was hidden and then made visible via Widget::Show. The visibility state of
the aura Window object remains as hidden, which results in the compositor not painting this window.

Fixes bug http://code.google.com/p/chromium/issues/detail?id=229913 where the composited panel window would turn black on Windows 8 if we
switched to the metro screen and back.

R=ben@chromium.org
BUG=229913
TEST=Covered by new views unit test TestWindowVisibilityAfterHide

Review URL: https://chromiumcodereview.appspot.com/13849012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195270 0039d316-1c4b-4281-b951-d872f2087c98
parent a4a6bdd1
......@@ -458,10 +458,12 @@ void DesktopNativeWidgetAura::Hide() {
void DesktopNativeWidgetAura::ShowMaximizedWithBounds(
const gfx::Rect& restored_bounds) {
desktop_root_window_host_->ShowMaximizedWithBounds(restored_bounds);
window_->Show();
}
void DesktopNativeWidgetAura::ShowWithWindowState(ui::WindowShowState state) {
desktop_root_window_host_->ShowWindowWithState(state);
window_->Show();
}
bool DesktopNativeWidgetAura::IsVisible() const {
......
......@@ -1444,6 +1444,29 @@ TEST_F(WidgetTest, DesktopAuraFullscreenChildParentDestroyed) {
RunPendingMessages();
}
// Test to ensure that the aura Window's visiblity state is set to visible if
// the underlying widget is hidden and then shown.
TEST_F(WidgetTest, TestWindowVisibilityAfterHide) {
// Create a widget.
Widget widget;
Widget::InitParams init_params =
CreateParams(Widget::InitParams::TYPE_WINDOW);
init_params.show_state = ui::SHOW_STATE_NORMAL;
gfx::Rect initial_bounds(0, 0, 300, 400);
init_params.bounds = initial_bounds;
init_params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
init_params.native_widget = new DesktopNativeWidgetAura(&widget);
widget.Init(init_params);
NonClientView* non_client_view = widget.non_client_view();
NonClientFrameView* frame_view = new MinimumSizeFrameView(&widget);
non_client_view->SetFrameView(frame_view);
widget.Hide();
EXPECT_FALSE(widget.GetNativeView()->IsVisible());
widget.Show();
EXPECT_TRUE(widget.GetNativeView()->IsVisible());
}
#endif // !defined(OS_CHROMEOS)
// Tests that wheel events generted from scroll events are targetted to the
......
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