Commit b519694c authored by Ahmed Fakhry's avatar Ahmed Fakhry Committed by Commit Bot

Exit overview on shelf alignment changes

Since the display work area bounds are not updated
when the shelf alignment changes while in overview
mode, then updating the grid bounds won't make any
difference, so we simply exit overview.

BUG=990293
TEST=Added a test

Change-Id: I545edaea9080012c34263a6f48962fbf710e984c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1733797Reviewed-by: default avatarSammie Quon <sammiequon@chromium.org>
Commit-Queue: Ahmed Fakhry <afakhry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683803}
parent 1f8a6a4e
...@@ -892,6 +892,14 @@ void OverviewSession::OnShellDestroying() { ...@@ -892,6 +892,14 @@ void OverviewSession::OnShellDestroying() {
EndOverview(); EndOverview();
} }
void OverviewSession::OnShelfAlignmentChanged(aura::Window* root_window) {
// When the shelf alignment changes while in overview, the display work area
// doesn't get updated anyways (see https://crbug.com/834400). In this case,
// even updating the grid bounds won't make any difference, so we simply exit
// overview.
EndOverview();
}
void OverviewSession::OnSplitViewStateChanged(SplitViewState previous_state, void OverviewSession::OnSplitViewStateChanged(SplitViewState previous_state,
SplitViewState state) { SplitViewState state) {
// Do nothing if overview is being shutdown. // Do nothing if overview is being shutdown.
......
...@@ -246,6 +246,7 @@ class ASH_EXPORT OverviewSession : public display::DisplayObserver, ...@@ -246,6 +246,7 @@ class ASH_EXPORT OverviewSession : public display::DisplayObserver,
// ShelObserver: // ShelObserver:
void OnShellDestroying() override; void OnShellDestroying() override;
void OnShelfAlignmentChanged(aura::Window* root_window) override;
// ui::EventHandler: // ui::EventHandler:
void OnKeyEvent(ui::KeyEvent* event) override; void OnKeyEvent(ui::KeyEvent* event) override;
......
...@@ -2793,6 +2793,14 @@ TEST_F(OverviewSessionTest, SelectingWindowWithBackdrop) { ...@@ -2793,6 +2793,14 @@ TEST_F(OverviewSessionTest, SelectingWindowWithBackdrop) {
EXPECT_FALSE(InOverviewSession()); EXPECT_FALSE(InOverviewSession());
} }
TEST_F(OverviewSessionTest, ShelfAlignmentChangeWhileInOverview) {
Shelf* shelf = GetPrimaryShelf();
shelf->SetAlignment(SHELF_ALIGNMENT_BOTTOM);
ToggleOverview();
shelf->SetAlignment(SHELF_ALIGNMENT_RIGHT);
EXPECT_FALSE(InOverviewSession());
}
class OverviewSessionNewLayoutTest : public OverviewSessionTest { class OverviewSessionNewLayoutTest : public OverviewSessionTest {
public: public:
OverviewSessionNewLayoutTest() = default; OverviewSessionNewLayoutTest() = default;
......
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