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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | ash/utility/screenshot_controller_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/utility/screenshot_controller.h" 5 #include "ash/utility/screenshot_controller.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "ash/common/shell_window_ids.h" 9 #include "ash/common/shell_window_ids.h"
10 #include "ash/display/mouse_cursor_event_filter.h" 10 #include "ash/display/mouse_cursor_event_filter.h"
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 292
293 if (!pen_events_only_) { 293 if (!pen_events_only_) {
294 cursor_setter_.reset(new ScopedCursorSetter( 294 cursor_setter_.reset(new ScopedCursorSetter(
295 Shell::GetInstance()->cursor_manager(), ui::kCursorCross)); 295 Shell::GetInstance()->cursor_manager(), ui::kCursorCross));
296 } 296 }
297 297
298 EnableMouseWarp(false); 298 EnableMouseWarp(false);
299 } 299 }
300 300
301 void ScreenshotController::CancelScreenshotSession() { 301 void ScreenshotController::CancelScreenshotSession() {
302 for (aura::Window* root : Shell::GetAllRootWindows()) {
303 // Having pre-handled all mouse events, widgets that had mouse capture may
304 // now misbehave, so break any existing captures. Do this after the
305 // screenshot session is over so that it's still possible to screenshot
306 // things like menus.
307 aura::client::GetCaptureClient(root)->SetCapture(nullptr);
308 }
309
302 mode_ = NONE; 310 mode_ = NONE;
303 pen_events_only_ = false; 311 pen_events_only_ = false;
304 root_window_ = nullptr; 312 root_window_ = nullptr;
305 SetSelectedWindow(nullptr); 313 SetSelectedWindow(nullptr);
306 screenshot_delegate_ = nullptr; 314 screenshot_delegate_ = nullptr;
307 display::Screen::GetScreen()->RemoveObserver(this); 315 display::Screen::GetScreen()->RemoveObserver(this);
308 layers_.clear(); 316 layers_.clear();
309 cursor_setter_.reset(); 317 cursor_setter_.reset();
310 EnableMouseWarp(true); 318 EnableMouseWarp(true);
311 319
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 550
543 void ScreenshotController::OnDisplayMetricsChanged( 551 void ScreenshotController::OnDisplayMetricsChanged(
544 const display::Display& display, 552 const display::Display& display,
545 uint32_t changed_metrics) {} 553 uint32_t changed_metrics) {}
546 554
547 void ScreenshotController::OnWindowDestroying(aura::Window* window) { 555 void ScreenshotController::OnWindowDestroying(aura::Window* window) {
548 SetSelectedWindow(nullptr); 556 SetSelectedWindow(nullptr);
549 } 557 }
550 558
551 } // namespace ash 559 } // namespace ash
OLDNEW
« 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