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

Unified Diff: ash/utility/screenshot_controller.cc

Issue 2393703002: Fix partial screenshot/window screenshot when holding Alt+Tab. (Closed)
Patch Set: unit 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..af86bb06e52bf5190f41e4bf9e124cefa600bd82 100644
--- a/ash/utility/screenshot_controller.cc
+++ b/ash/utility/screenshot_controller.cc
@@ -260,6 +260,9 @@ void ScreenshotController::StartWindowScreenshotSession(
display::Screen::GetScreen()->AddObserver(this);
for (aura::Window* root : Shell::GetAllRootWindows()) {
+ // Since we'll be pre-handling all mouse events, break any existing
+ // captures.
+ aura::client::GetCaptureClient(root)->SetCapture(nullptr);
sky 2016/10/05 15:57:35 I'm mildly worried about side effects this may hav
Evan Stade 2016/10/05 17:21:37 I was actually thinking that any side effects woul
sky 2016/10/06 15:45:50 Sorry for not being clear on side effects. I was m
Evan Stade 2016/10/06 16:32:34 done (I assume you meant to move the whole loop?)
layers_[root] = base::MakeUnique<ScreenshotLayer>(
Shell::GetContainer(root, kShellWindowId_OverlayContainer)->layer(),
true);
@@ -285,6 +288,9 @@ void ScreenshotController::StartPartialScreenshotSession(
mode_ = PARTIAL;
display::Screen::GetScreen()->AddObserver(this);
for (aura::Window* root : Shell::GetAllRootWindows()) {
+ // Since we'll be pre-handling all mouse events, break any existing
+ // captures.
+ aura::client::GetCaptureClient(root)->SetCapture(nullptr);
layers_[root] = base::MakeUnique<ScreenshotLayer>(
Shell::GetContainer(root, kShellWindowId_OverlayContainer)->layer(),
draw_overlay_immediately);
« 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