Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(400)

Unified Diff: ash/common/wm/default_state.cc

Issue 2622053004: ash: Restore previous show state after exiting fullscreen. (Closed)
Patch Set: Rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/common/wm/window_state_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | ash/common/wm/window_state_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698