diff options
author | derat <derat@chromium.org> | 2014-09-18 09:40:48 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-18 16:40:58 +0000 |
commit | 2430b2a3cfbdf230c24b7ac05a19a07eb57cca90 (patch) | |
tree | 31dcca7c016688853e97327ff8126e6116df5879 /ash/display | |
parent | 758f9d0723587e50f3ebab8f1de315443893b6d6 (diff) | |
download | chromium_src-2430b2a3cfbdf230c24b7ac05a19a07eb57cca90.zip chromium_src-2430b2a3cfbdf230c24b7ac05a19a07eb57cca90.tar.gz chromium_src-2430b2a3cfbdf230c24b7ac05a19a07eb57cca90.tar.bz2 |
ash: Avoid treating screen resizes as user activity.
Tell UserActivityDetector to ignore mouse events received
soon after notification that displays have been changed.
Previously, the events were only ignored after making
requests to configure displays, but this appears to be
insufficient in some cases where configuration takes longer
than a second.
BUG=360634
Review URL: https://codereview.chromium.org/570303003
Cr-Commit-Position: refs/heads/master@{#295482}
Diffstat (limited to 'ash/display')
-rw-r--r-- | ash/display/display_change_observer_chromeos.cc | 8 | ||||
-rw-r--r-- | ash/display/display_manager.cc | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/ash/display/display_change_observer_chromeos.cc b/ash/display/display_change_observer_chromeos.cc index 585d94d..4065c91 100644 --- a/ash/display/display_change_observer_chromeos.cc +++ b/ash/display/display_change_observer_chromeos.cc @@ -26,6 +26,7 @@ #include "ui/events/device_data_manager.h" #include "ui/events/touchscreen_device.h" #include "ui/gfx/display.h" +#include "ui/wm/core/user_activity_detector.h" namespace ash { @@ -246,6 +247,13 @@ void DisplayChangeObserver::OnDisplayModeChanged( &displays, ui::DeviceDataManager::GetInstance()->touchscreen_devices()); // DisplayManager can be null during the boot. Shell::GetInstance()->display_manager()->OnNativeDisplaysChanged(displays); + + // For the purposes of user activity detection, ignore synthetic mouse events + // that are triggered by screen resizes: http://crbug.com/360634 + ::wm::UserActivityDetector* user_activity_detector = + Shell::GetInstance()->user_activity_detector(); + if (user_activity_detector) + user_activity_detector->OnDisplayPowerChanging(); } void DisplayChangeObserver::OnAppTerminating() { diff --git a/ash/display/display_manager.cc b/ash/display/display_manager.cc index 6660921..291dddb 100644 --- a/ash/display/display_manager.cc +++ b/ash/display/display_manager.cc @@ -651,7 +651,7 @@ void DisplayManager::SetColorCalibrationProfile( void DisplayManager::OnNativeDisplaysChanged( const std::vector<DisplayInfo>& updated_displays) { if (updated_displays.empty()) { - VLOG(1) << "OnNativeDisplayChanged(0): # of current displays=" + VLOG(1) << "OnNativeDisplaysChanged(0): # of current displays=" << displays_.size(); // If the device is booted without display, or chrome is started // without --ash-host-window-bounds on linux desktop, use the |