summaryrefslogtreecommitdiffstats
path: root/remoting/host/local_input_monitor_mac.mm
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-12 01:32:51 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-12 01:32:51 +0000
commit1bed4a2c2a506e071b6d034cf0c510c2468dd1cd (patch)
tree302878f88747ea1d4fc958fcb103707523fd7d74 /remoting/host/local_input_monitor_mac.mm
parent402c892c6e48c4ad7e5a109513f00730d25d20ca (diff)
downloadchromium_src-1bed4a2c2a506e071b6d034cf0c510c2468dd1cd.zip
chromium_src-1bed4a2c2a506e071b6d034cf0c510c2468dd1cd.tar.gz
chromium_src-1bed4a2c2a506e071b6d034cf0c510c2468dd1cd.tar.bz2
Fix LocalInputMonitorMac to ignore invalid mouse-move events
In some cases the host may get invalid mouse-move events, so it thinks that local user is moving the mouse, and as result it starts dropping all input events. Now LocalInputMonitorMac ignores mouse-move event when mouse position isn't changing. BUG=360912 R=jamiewalch@chromium.org Review URL: https://codereview.chromium.org/233083005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263445 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/local_input_monitor_mac.mm')
-rw-r--r--remoting/host/local_input_monitor_mac.mm11
1 files changed, 11 insertions, 0 deletions
diff --git a/remoting/host/local_input_monitor_mac.mm b/remoting/host/local_input_monitor_mac.mm
index 1e89587..8c3ddc9 100644
--- a/remoting/host/local_input_monitor_mac.mm
+++ b/remoting/host/local_input_monitor_mac.mm
@@ -190,6 +190,8 @@ class LocalInputMonitorMac::Core
// and session disconnect requests.
base::WeakPtr<ClientSessionControl> client_session_control_;
+ webrtc::DesktopVector mouse_position_;
+
DISALLOW_COPY_AND_ASSIGN(Core);
};
@@ -251,6 +253,15 @@ void LocalInputMonitorMac::Core::StopOnUiThread() {
void LocalInputMonitorMac::Core::OnLocalMouseMoved(
const webrtc::DesktopVector& position) {
+ // In some cases OS may emit bogus mouse-move events even when cursor is not
+ // actually moving. To handle this case properly verify that mouse position
+ // has changed. See crbug.com/360912 .
+ if (position.equals(mouse_position_)) {
+ return;
+ }
+
+ mouse_position_ = position;
+
caller_task_runner_->PostTask(
FROM_HERE, base::Bind(&ClientSessionControl::OnLocalMouseMoved,
client_session_control_,