Commit c75859d9 authored by Xiyuan Xia's avatar Xiyuan Xia Committed by Commit Bot

SPM: Fix not painting after activating minimized windows

Minimizing a window triggers the following:
DesktopWindowTreeHostMus::OnWindowTreeHostWindowVisibilityChanged
=> WindowTreeHost::Hide()
=> Compositor::SetVisible(false)

Focusing on a minimized window implicitly unminimizing it. However,
Compositor::SetVisible(true) is not called hence the bug. This CL
adds the call to RestoreToPreminimizedState to fix the issue.

Bug: 942787
Change-Id: I37c7e99ebb01c8eb4cefefcf8c377b2c31c908fd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1533151Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Xiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#642910}
parent 552c69fb
......@@ -294,6 +294,8 @@ void DesktopWindowTreeHostMus::RestoreToPreminimizedState() {
window_tree_host_window_observer_->set_is_waiting_for_restore(true);
base::AutoReset<bool> setter(&is_updating_window_visibility_, true);
window()->Show();
if (compositor())
compositor()->SetVisible(true);
}
void DesktopWindowTreeHostMus::OnWindowTreeHostWindowVisibilityChanged(
......
......@@ -735,6 +735,7 @@ TEST_F(DesktopWindowTreeHostMusTest, MinimizeActivate) {
EXPECT_TRUE(widget->IsActive());
EXPECT_TRUE(widget->IsVisible());
EXPECT_FALSE(widget->IsMinimized());
EXPECT_TRUE(widget->GetNativeWindow()->GetHost()->compositor()->IsVisible());
}
TEST_F(DesktopWindowTreeHostMusTest, MaximizeMinimizeRestore) {
......
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