Commit 6035d526 authored by Kazuki Takise's avatar Kazuki Takise Committed by Commit Bot

Don't dismiss app list when showing alt-tab cycler in tablet mode

In tablet mode, the app list is expected to remain visible when
the cycler is shown, so it shouldn't be dismissed.

BUG: 1024494
TEST: Home screen isn't blank after using alt-tab in tablet mode
Change-Id: Iade57ac11528d11501e8b319f2d5dbdbc6716b6e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1927791Reviewed-by: default avatarXiaoqian Dai <xdai@chromium.org>
Reviewed-by: default avatarStefan Kuhne <skuhne@chromium.org>
Commit-Queue: Kazuki Takise <takise@chromium.org>
Auto-Submit: Kazuki Takise <takise@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721751}
parent d7bb1e1e
......@@ -9,6 +9,7 @@
#include "ash/app_list/test/app_list_test_helper.h"
#include "ash/focus_cycler.h"
#include "ash/home_screen/home_screen_controller.h"
#include "ash/public/cpp/ash_features.h"
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/public/cpp/window_properties.h"
......@@ -24,6 +25,7 @@
#include "ash/wm/desks/desk.h"
#include "ash/wm/desks/desks_controller.h"
#include "ash/wm/desks/desks_test_util.h"
#include "ash/wm/tablet_mode/tablet_mode_controller_test_api.h"
#include "ash/wm/window_cycle_list.h"
#include "ash/wm/window_state.h"
#include "ash/wm/window_util.h"
......@@ -505,6 +507,25 @@ TEST_F(WindowCycleControllerTest, SelectingHidesAppList) {
controller->CompleteCycling();
}
// Tests that beginning window selection doesn't hide the app list in tablet
// mode.
TEST_F(WindowCycleControllerTest, SelectingDoesNotHideAppListInTabletMode) {
TabletModeControllerTestApi().EnterTabletMode();
EXPECT_TRUE(TabletModeControllerTestApi().IsTabletModeStarted());
EXPECT_TRUE(Shell::Get()->home_screen_controller()->IsHomeScreenVisible());
std::unique_ptr<aura::Window> window0(CreateTestWindowInShellWithId(0));
std::unique_ptr<aura::Window> window1(CreateTestWindowInShellWithId(1));
wm::ActivateWindow(window0.get());
WindowCycleController* controller = Shell::Get()->window_cycle_controller();
controller->HandleCycleWindow(WindowCycleController::FORWARD);
window0->Hide();
window1->Hide();
EXPECT_TRUE(Shell::Get()->home_screen_controller()->IsHomeScreenVisible());
}
// Tests that cycling through windows doesn't change their minimized state.
TEST_F(WindowCycleControllerTest, CyclePreservesMinimization) {
WindowCycleController* controller = Shell::Get()->window_cycle_controller();
......
......@@ -603,8 +603,9 @@ void WindowCycleList::InitWindowCycleView() {
widget->GetNativeWindow()->GetRootWindow(),
std::make_unique<CustomWindowTargeter>(widget->GetNativeWindow()));
}
// Close the app list, if it's open.
Shell::Get()->app_list_controller()->DismissAppList();
// Close the app list, if it's open in clamshell mode.
if (!Shell::Get()->tablet_mode_controller()->InTabletMode())
Shell::Get()->app_list_controller()->DismissAppList();
}
void WindowCycleList::SelectWindow(aura::Window* window) {
......
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