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

Unified Diff: remoting/client/plugin/normalizing_input_filter_cros.cc

Issue 1143943002: Filter spurious mouse move events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reviewer feedback. Created 5 years, 7 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 | « remoting/client/plugin/normalizing_input_filter_cros.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/plugin/normalizing_input_filter_cros.cc
diff --git a/remoting/client/plugin/normalizing_input_filter_cros.cc b/remoting/client/plugin/normalizing_input_filter_cros.cc
index bd4cb80f38591284bc3dfe1fe083294bf573170c..0a64e46218626326d2f49fc81c7b445ef7fb667f 100644
--- a/remoting/client/plugin/normalizing_input_filter_cros.cc
+++ b/remoting/client/plugin/normalizing_input_filter_cros.cc
@@ -98,7 +98,9 @@ NormalizingInputFilterCros::NormalizingInputFilterCros(
: protocol::InputFilter(input_stub),
deferred_key_is_rewriting_(false),
modifying_key_(0),
- left_alt_is_pressed_(false) {
+ left_alt_is_pressed_(false),
+ previous_mouse_x_(-1),
+ previous_mouse_y_(-1) {
}
NormalizingInputFilterCros::~NormalizingInputFilterCros() {}
@@ -117,8 +119,21 @@ void NormalizingInputFilterCros::InjectKeyEvent(
void NormalizingInputFilterCros::InjectMouseEvent(
const protocol::MouseEvent& event) {
- if (deferred_keydown_event_.has_usb_keycode())
- SwitchRewritingKeyToModifying();
+ // If there's a rewriting/modifier decision pending, assume that it's
+ // intended to be used as a modifying key for this mouse event and send it.
+ if (deferred_keydown_event_.has_usb_keycode()) {
+ // TODO(jamiewalch): Until crbug.com/489468 is fixed, a spurious mouse move
+ // event is generated in response to certain key combinations, so check that
+ // this is actually an "interesting" event.
+ if (event.has_button() ||
+ event.x() != previous_mouse_x_ ||
+ event.y() != previous_mouse_y_) {
+ SwitchRewritingKeyToModifying();
+ }
+ }
+ previous_mouse_x_ = event.x();
+ previous_mouse_y_ = event.y();
+
protocol::MouseEvent newEvent = event;
if (left_alt_is_pressed_ &&
event.has_button() &&
« no previous file with comments | « remoting/client/plugin/normalizing_input_filter_cros.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698