New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 808537 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug

Blocking:
issue 177475



Sign in to add a comment

middle mouse button injection code in input_injector_evdev.cc looks wrong

Project Member Reported by thakis@chromium.org, Feb 2 2018

Issue description

https://codereview.chromium.org/755883002/diff/120001/ui/events/ozone/evdev/input_injector_evdev.cc added:

	 32   switch(button) {
 33     case EF_LEFT_MOUSE_BUTTON:
 34       changed_button = EVDEV_MODIFIER_LEFT_MOUSE_BUTTON;
 35       break;
 36     case EF_RIGHT_MOUSE_BUTTON:
 37       changed_button = EVDEV_MODIFIER_RIGHT_MOUSE_BUTTON;
 38       break;
 39     case EF_MIDDLE_MOUSE_BUTTON:
 40       changed_button = EVDEV_MODIFIER_MIDDLE_MOUSE_BUTTON;
 41     default:
 42       LOG(WARNING) << "Invalid flag: " << button << " for the button parameter";
 43       return;
 44   }


The MIDDLE_MOUSE_BUTTON case misses a break and hence falls through to the early return. I suppose this isn't intentional? What are the ramifications of this? What is this injector used for?
 
Components: Services>Chromoting
Labels: -OS-Linux OS-Chrome
I believe this is used in chromoting.

Comment 2 by spang@chromium.org, Feb 2 2018

Oh dear. Yeah, this would prevent sending a middle click when remoting into a Chrome OS device.
That does look wrong. Though I'm not exactly sure what, if anything, middle-mouse-button does in Chrome OS. If nothing, that could explain why the bug has gone unnoticed?

Doesn't it open a link in a new tab? That's what it does on Windows and Linux.
I think you can't use middle-click unless you are using an external mouse on a chromebook, which is probably not very often?
If you remote from a device with a three-button mouse to a chromebook, you could middleclick on your local mouse I suppose (?)
You could remote in, then middle-click. But then the bug you've found means that nothing would happen :)
I've just tried plugging my mouse into my Chromebook. And middle-click does indeed open links in a new tab.
And I've just tried remoting in. And indeed, middle-click fails, though the other 2 buttons work as expected!
So, thanks and well done for spotting this issue!

Owner: thakis@chromium.org
Status: Assigned (was: Untriaged)
Since you found the issue in the code, and it's trivial, please could you upload a patch and send it to one of us (or whoever owns this code)?

Can do, but can't write a test (so you might want to do that part yourself).
Project Member

Comment 10 by bugdroid1@chromium.org, Feb 3 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a09247deb0958f075c47c76201a2e47bd74fda01

commit a09247deb0958f075c47c76201a2e47bd74fda01
Author: Nico Weber <thakis@chromium.org>
Date: Sat Feb 03 01:42:23 2018

Enable -Wimplicit-fallthrough on (non-Chrome OS) Ozone.

Fixes a bug where middle mouse clicks where ignored when remoting into a Chrome OS device.

Also found https://chromium-review.googlesource.com/c/chromium/src/+/899585

Bug:  177475 , 808537 
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_vr;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I64e259f1e2d2c817364ee9249e72cb24abc395be
Reviewed-on: https://chromium-review.googlesource.com/899984
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Michael Spang <spang@chromium.org>
Reviewed-by: Lambros Lambrou <lambroslambrou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534234}
[modify] https://crrev.com/a09247deb0958f075c47c76201a2e47bd74fda01/build/config/compiler/BUILD.gn
[modify] https://crrev.com/a09247deb0958f075c47c76201a2e47bd74fda01/ui/events/ozone/evdev/input_injector_evdev.cc
[modify] https://crrev.com/a09247deb0958f075c47c76201a2e47bd74fda01/ui/ozone/demo/surfaceless_gl_renderer.cc

Do you want to close this out or keep it open for adding test coverage?
Project Member

Comment 12 by bugdroid1@chromium.org, Feb 5 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/885eeb25383608a29df6b4dd40cd70cf3e068035

commit 885eeb25383608a29df6b4dd40cd70cf3e068035
Author: Lambros Lambrou <lambroslambrou@chromium.org>
Date: Mon Feb 05 18:24:10 2018

Add unittest for middle-mouse-button injection

This adds missing unittest coverage for ozone evdev input-injection.

Bug:  808537 
Change-Id: Iac1bc5544d68b37e45aaab6325b1c370ec926ee8
Reviewed-on: https://chromium-review.googlesource.com/902185
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Michael Spang <spang@chromium.org>
Commit-Queue: Michael Spang <spang@chromium.org>
Commit-Queue: Lambros Lambrou <lambroslambrou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534427}
[modify] https://crrev.com/885eeb25383608a29df6b4dd40cd70cf3e068035/ui/events/ozone/evdev/input_injector_evdev_unittest.cc

Status: Fixed (was: Assigned)

Sign in to add a comment