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

Unified Diff: ui/aura/client/default_capture_client.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
Index: ui/aura/client/default_capture_client.cc
diff --git a/ui/aura/client/default_capture_client.cc b/ui/aura/client/default_capture_client.cc
index 2740c9f8e19224a26cf36aa9330d214ae5b37a0c..b0719fc14e62849042298d330df840bcdd4f1c84 100644
--- a/ui/aura/client/default_capture_client.cc
+++ b/ui/aura/client/default_capture_client.cc
@@ -11,6 +11,10 @@
namespace aura {
namespace client {
+// static
+// Track the active capture window across root windows.
+Window* global_capture_window_ = nullptr;
+
DefaultCaptureClient::DefaultCaptureClient(Window* root_window)
: root_window_(root_window),
capture_window_(NULL) {
@@ -18,6 +22,8 @@ DefaultCaptureClient::DefaultCaptureClient(Window* root_window)
}
DefaultCaptureClient::~DefaultCaptureClient() {
+ if (global_capture_window_ == capture_window_)
+ global_capture_window_ = nullptr;
SetCaptureClient(root_window_, NULL);
}
@@ -29,6 +35,7 @@ void DefaultCaptureClient::SetCapture(Window* window) {
Window* old_capture_window = capture_window_;
capture_window_ = window;
+ global_capture_window_ = window;
CaptureDelegate* capture_delegate = root_window_->GetHost()->dispatcher();
if (capture_window_)
@@ -50,7 +57,7 @@ Window* DefaultCaptureClient::GetCaptureWindow() {
}
Window* DefaultCaptureClient::GetGlobalCaptureWindow() {
- return capture_window_;
+ return global_capture_window_;
}
} // namespace client
« no previous file with comments | « components/mus/public/cpp/lib/window_tree_client_impl.cc ('k') | ui/views/controls/menu/menu_runner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698