Commit 2430b2a3 authored by derat's avatar derat Committed by Commit bot

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}
parent 758f9d07
......@@ -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() {
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment