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

Unified Diff: components/mus/public/cpp/lib/window_tree_client_impl.cc

Issue 1953753002: Turn RootWindowController Menus Async (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « ash/root_window_controller.cc ('k') | ui/aura/client/default_capture_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/public/cpp/lib/window_tree_client_impl.cc
diff --git a/components/mus/public/cpp/lib/window_tree_client_impl.cc b/components/mus/public/cpp/lib/window_tree_client_impl.cc
index dc439ce190eba16798135df213c721a1aab28424..2fb60f3fe58f958ca93f24e48cd7cc3c30ee923b 100644
--- a/components/mus/public/cpp/lib/window_tree_client_impl.cc
+++ b/components/mus/public/cpp/lib/window_tree_client_impl.cc
@@ -196,6 +196,16 @@ void WindowTreeClientImpl::WaitForEmbed() {
}
void WindowTreeClientImpl::DestroyWindow(Window* window) {
+ // TODO(jonross): Also clear the focused window (crbug.com/611983)
+ if (window == capture_window_) {
+ InFlightCaptureChange reset_change(this, nullptr);
+ ApplyServerChangeToExistingInFlightChange(reset_change);
+ // Normally just updating the queued changes is sufficient. However since
+ // |window| is being destroyed, it will not be possible to notify its
+ // observers
+ // of the lost capture. Update local state now.
+ LocalSetCapture(nullptr);
+ }
DCHECK(tree_);
const uint32_t change_id = ScheduleInFlightChange(base::WrapUnique(
new CrashInFlightChange(window, ChangeType::DELETE_WINDOW)));
« no previous file with comments | « ash/root_window_controller.cc ('k') | ui/aura/client/default_capture_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698