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

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: Addressed some review comments 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
« no previous file with comments | « components/mus/ws/connection_manager.h ('k') | components/mus/ws/default_access_policy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_)
« no previous file with comments | « components/mus/ws/connection_manager.h ('k') | components/mus/ws/default_access_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698