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

Unified Diff: ash/utility/screenshot_controller.cc

Issue 2393703002: Fix partial screenshot/window screenshot when holding Alt+Tab. (Closed)
Patch Set: update test Created 4 years, 2 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 | « no previous file | ash/utility/screenshot_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/utility/screenshot_controller.cc
diff --git a/ash/utility/screenshot_controller.cc b/ash/utility/screenshot_controller.cc
index 64e4f99785f09fd729063fb9d05434708c248969..f9eadb7b68767b72a54b2a787122a7be88934af3 100644
--- a/ash/utility/screenshot_controller.cc
+++ b/ash/utility/screenshot_controller.cc
@@ -299,6 +299,14 @@ void ScreenshotController::StartPartialScreenshotSession(
}
void ScreenshotController::CancelScreenshotSession() {
+ for (aura::Window* root : Shell::GetAllRootWindows()) {
+ // Having pre-handled all mouse events, widgets that had mouse capture may
+ // now misbehave, so break any existing captures. Do this after the
+ // screenshot session is over so that it's still possible to screenshot
+ // things like menus.
+ aura::client::GetCaptureClient(root)->SetCapture(nullptr);
+ }
+
mode_ = NONE;
pen_events_only_ = false;
root_window_ = nullptr;
« no previous file with comments | « no previous file | ash/utility/screenshot_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698