| Index: components/mus/ws/window_manager_state.cc
|
| diff --git a/components/mus/ws/window_manager_state.cc b/components/mus/ws/window_manager_state.cc
|
| index c81bb8cb86b78b4d1ccfc2e6e0649a9e30cc96f3..8d50d55c44f998e3eed9fe5342d63628b33ae78f 100644
|
| --- a/components/mus/ws/window_manager_state.cc
|
| +++ b/components/mus/ws/window_manager_state.cc
|
| @@ -128,8 +128,9 @@ bool WindowManagerState::SetCapture(ServerWindow* window,
|
| void WindowManagerState::ReleaseCaptureBlockedByModalWindow(
|
| const ServerWindow* modal_window) {
|
| if (!capture_window() || !modal_window->is_modal() ||
|
| - !modal_window->IsDrawn())
|
| + !modal_window->IsDrawn()) {
|
| return;
|
| + }
|
|
|
| if (modal_window->transient_parent() &&
|
| !modal_window->transient_parent()->Contains(capture_window())) {
|
| @@ -140,12 +141,25 @@ void WindowManagerState::ReleaseCaptureBlockedByModalWindow(
|
| }
|
|
|
| void WindowManagerState::ReleaseCaptureBlockedByAnyModalWindow() {
|
| - if (!capture_window() || !capture_window()->IsBlockedByModalWindow())
|
| + if (!capture_window())
|
| + return;
|
| +
|
| + bool has_system_modal =
|
| + system_modal_window() && system_modal_window()->IsDrawn();
|
| +
|
| + if (!has_system_modal && !capture_window()->IsBlockedByModalWindow())
|
| return;
|
|
|
| SetCapture(nullptr, false);
|
| }
|
|
|
| +bool WindowManagerState::SetSystemModalWindow(ServerWindow* window) {
|
| + DCHECK(!window->transient_parent());
|
| + if (system_modal_window() == window)
|
| + return true;
|
| + return event_dispatcher_.SetSystemModalWindow(window);
|
| +}
|
| +
|
| mojom::DisplayPtr WindowManagerState::ToMojomDisplay() const {
|
| mojom::DisplayPtr display_ptr = display_->ToMojomDisplay();
|
| // TODO(sky): set work area.
|
|
|