Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Unified Diff: components/mus/ws/connection_manager.cc

Issue 1759523002: mus: Server-side implementation of modal windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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) {
+ 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_)

Powered by Google App Engine
This is Rietveld 408576698