| Index: ash/common/wm/default_state.cc
|
| diff --git a/ash/common/wm/default_state.cc b/ash/common/wm/default_state.cc
|
| index e15f8884219b42d63652ccfadef7671c9e3e60e4..ba1b01ff136890b59d162c8a1c9bd3aa4fdb6a3f 100644
|
| --- a/ash/common/wm/default_state.cc
|
| +++ b/ash/common/wm/default_state.cc
|
| @@ -767,9 +767,27 @@ void DefaultState::UpdateBoundsFromState(WindowState* window_state,
|
| }
|
| }
|
|
|
| + if (window_state->IsFullscreen()) {
|
| + // Save the previous show state so that we can correctly restore it after
|
| + // exiting the fullscreen mode.
|
| + auto previous_ui_state_type = ToWindowShowState(previous_state_type);
|
| + if (previous_ui_state_type == ui::SHOW_STATE_MINIMIZED) {
|
| + // If the previous show state is ui::SHOW_STATE_MINIMIZED, we will use
|
| + // the show state before the window was minimized. But if the window
|
| + // was fullscreen before it was minimized, we will keep the
|
| + // PreFullscreenShowStat unchanged.
|
| + previous_ui_state_type = window->GetPreMinimizedShowState();
|
| + if (previous_ui_state_type != ui::SHOW_STATE_FULLSCREEN)
|
| + window->SetPreFullscreenShowState(previous_ui_state_type);
|
| + } else {
|
| + window->SetPreFullscreenShowState(previous_ui_state_type);
|
| + }
|
| + }
|
| +
|
| if (window_state->IsMinimized()) {
|
| - // Save the previous show state so that we can correctly restore it.
|
| - window->SetRestoreShowState(ToWindowShowState(previous_state_type));
|
| + // Save the previous show state so that we can correctly restore it after
|
| + // exiting the minimized mode.
|
| + window->SetPreMinimizedShowState(ToWindowShowState(previous_state_type));
|
| window->SetVisibilityAnimationType(
|
| WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE);
|
|
|
|
|