| Index: components/mus/ws/display.cc
|
| diff --git a/components/mus/ws/display.cc b/components/mus/ws/display.cc
|
| index ef878ead97ca64be53fc4cd3dd92951f8f1fb127..410a8359547a01a60fcc01fa3901ccf4983e8eb3 100644
|
| --- a/components/mus/ws/display.cc
|
| +++ b/components/mus/ws/display.cc
|
| @@ -213,11 +213,24 @@ const WindowManagerState* Display::GetWindowManagerStateForUser(
|
| return iter == window_manager_state_map_.end() ? nullptr : iter->second.get();
|
| }
|
|
|
| -void Display::SetCapture(ServerWindow* window, bool in_nonclient_area) {
|
| +bool Display::SetCapture(ServerWindow* window, bool in_nonclient_area) {
|
| ServerWindow* capture_window = event_dispatcher_.capture_window();
|
| if (capture_window == window)
|
| + return true;
|
| + return event_dispatcher_.SetCaptureWindow(window, in_nonclient_area);
|
| +}
|
| +
|
| +void Display::ReleaseCaptureForModalWindow(ServerWindow* window) {
|
| + if (!window->is_modal() || !window->IsDrawn())
|
| + return;
|
| +
|
| + ServerWindow* capture_window = GetCaptureWindow();
|
| + if (window->transient_parent() &&
|
| + !window->transient_parent()->Contains(capture_window)) {
|
| return;
|
| - event_dispatcher_.SetCaptureWindow(window, in_nonclient_area);
|
| + }
|
| +
|
| + SetCapture(nullptr, false);
|
| }
|
|
|
| mojom::Rotation Display::GetRotation() const {
|
|
|