Commit 1c33adc8 authored by Avery Musbach's avatar Avery Musbach Committed by Commit Bot

wm: Disable Alt+Tab during window dragging

Test: manual
Change-Id: I06df2ec89e48c9bd620ee1698a2dd4549e6ca45a
Fixed: 1046517, 1047758
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2032235
Commit-Queue: Avery Musbach <amusbach@chromium.org>
Reviewed-by: default avatarXiaoqian Dai <xdai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#737545}
parent bd903048
...@@ -14,9 +14,12 @@ ...@@ -14,9 +14,12 @@
#include "ash/wm/desks/desks_controller.h" #include "ash/wm/desks/desks_controller.h"
#include "ash/wm/desks/desks_util.h" #include "ash/wm/desks/desks_util.h"
#include "ash/wm/mru_window_tracker.h" #include "ash/wm/mru_window_tracker.h"
#include "ash/wm/overview/overview_controller.h"
#include "ash/wm/overview/overview_session.h"
#include "ash/wm/screen_pinning_controller.h" #include "ash/wm/screen_pinning_controller.h"
#include "ash/wm/window_cycle_event_filter.h" #include "ash/wm/window_cycle_event_filter.h"
#include "ash/wm/window_cycle_list.h" #include "ash/wm/window_cycle_list.h"
#include "ash/wm/window_state.h"
#include "ash/wm/window_util.h" #include "ash/wm/window_util.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics.h"
...@@ -59,6 +62,20 @@ void ReportPossibleDesksSwitchStats(int active_desk_container_id_before_cycle) { ...@@ -59,6 +62,20 @@ void ReportPossibleDesksSwitchStats(int active_desk_container_id_before_cycle) {
desks_util::kMaxNumberOfDesks); desks_util::kMaxNumberOfDesks);
} }
bool IsAnyWindowDragged() {
OverviewController* overview_controller = Shell::Get()->overview_controller();
if (overview_controller->InOverviewSession() &&
overview_controller->overview_session()->IsAnyOverviewItemDragged()) {
return true;
}
for (aura::Window* window :
Shell::Get()->mru_window_tracker()->BuildMruWindowList(kActiveDesk)) {
if (WindowState::Get(window)->is_dragged())
return true;
}
return false;
}
} // namespace } // namespace
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
...@@ -70,10 +87,10 @@ WindowCycleController::~WindowCycleController() = default; ...@@ -70,10 +87,10 @@ WindowCycleController::~WindowCycleController() = default;
// static // static
bool WindowCycleController::CanCycle() { bool WindowCycleController::CanCycle() {
// Prevent window cycling if the screen is locked or a modal dialog is open.
return !Shell::Get()->session_controller()->IsScreenLocked() && return !Shell::Get()->session_controller()->IsScreenLocked() &&
!Shell::IsSystemModalWindowOpen() && !Shell::IsSystemModalWindowOpen() &&
!Shell::Get()->screen_pinning_controller()->IsPinned(); !Shell::Get()->screen_pinning_controller()->IsPinned() &&
!IsAnyWindowDragged();
} }
void WindowCycleController::HandleCycleWindow(Direction direction) { void WindowCycleController::HandleCycleWindow(Direction direction) {
......
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