Index: components/mus/ws/connection_manager.cc |
diff --git a/components/mus/ws/connection_manager.cc b/components/mus/ws/connection_manager.cc |
index 47c896a9a1923277a1300105f6930d4188a88dfe..cdd8a4616b6e32f8533333c44acfb0ae5efba98d 100644 |
--- a/components/mus/ws/connection_manager.cc |
+++ b/components/mus/ws/connection_manager.cc |
@@ -675,6 +675,20 @@ void ConnectionManager::OnWillChangeWindowVisibility(ServerWindow* window) { |
} |
} |
+void ConnectionManager::OnWindowVisibilityChanged(ServerWindow* window) { |
sky
2016/03/04 17:00:42
What if the window is made modal when it's already
mohsen
2016/03/05 01:21:53
Both cases added.
|
+ if (!window->is_modal() || !window->IsDrawn()) |
+ return; |
+ |
+ WindowTreeHostImpl* host = GetWindowTreeHostByWindow(window); |
+ ServerWindow* capture_window = host->GetCaptureWindow(); |
+ if (window->transient_parent() && |
+ !window->transient_parent()->Contains(capture_window)) { |
+ return; |
+ } |
+ |
+ host->SetCapture(nullptr, false); |
+} |
+ |
void ConnectionManager::OnWindowPredefinedCursorChanged(ServerWindow* window, |
int32_t cursor_id) { |
if (in_destructor_) |