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

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

Issue 1949603002: Revert of mus: Enable system modal windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/window_manager_state.h ('k') | components/mus/ws/window_tree.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 71e69c4d4434ef16c794bd7931f443be8da3b0b6..681a52345687cd9536817f4c5dbb4ef4d18303b6 100644
--- a/components/mus/ws/window_manager_state.cc
+++ b/components/mus/ws/window_manager_state.cc
@@ -127,16 +127,23 @@
void WindowManagerState::ReleaseCaptureBlockedByModalWindow(
const ServerWindow* modal_window) {
- event_dispatcher_.ReleaseCaptureBlockedByModalWindow(modal_window);
+ if (!capture_window() || !modal_window->is_modal() ||
+ !modal_window->IsDrawn())
+ return;
+
+ if (modal_window->transient_parent() &&
+ !modal_window->transient_parent()->Contains(capture_window())) {
+ return;
+ }
+
+ SetCapture(nullptr, false);
}
void WindowManagerState::ReleaseCaptureBlockedByAnyModalWindow() {
- event_dispatcher_.ReleaseCaptureBlockedByAnyModalWindow();
-}
-
-void WindowManagerState::AddSystemModalWindow(ServerWindow* window) {
- DCHECK(!window->transient_parent());
- event_dispatcher_.AddSystemModalWindow(window);
+ if (!capture_window() || !capture_window()->IsBlockedByModalWindow())
+ return;
+
+ SetCapture(nullptr, false);
}
mojom::DisplayPtr WindowManagerState::ToMojomDisplay() const {
« no previous file with comments | « components/mus/ws/window_manager_state.h ('k') | components/mus/ws/window_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698