Commit 76d134f2 authored by spang@chromium.org's avatar spang@chromium.org

ozone: evdev: Don't crash without cursor in scroll & click events

TEST=chrome --ozone-platform=gbm
BUG=none
NOTRY=true

Review URL: https://codereview.chromium.org/302093004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274281 0039d316-1c4b-4281-b951-d872f2087c98
parent db060b18
...@@ -209,6 +209,8 @@ void GestureInterpreterLibevdevCros::OnGestureMove(const Gesture* gesture, ...@@ -209,6 +209,8 @@ void GestureInterpreterLibevdevCros::OnGestureMove(const Gesture* gesture,
void GestureInterpreterLibevdevCros::OnGestureScroll( void GestureInterpreterLibevdevCros::OnGestureScroll(
const Gesture* gesture, const Gesture* gesture,
const GestureScroll* scroll) { const GestureScroll* scroll) {
if (!cursor_)
return; // No cursor!
DVLOG(3) << base::StringPrintf("Gesture Scroll: (%f, %f) [%f, %f]", DVLOG(3) << base::StringPrintf("Gesture Scroll: (%f, %f) [%f, %f]",
scroll->dx, scroll->dx,
scroll->dy, scroll->dy,
...@@ -255,6 +257,8 @@ void GestureInterpreterLibevdevCros::Dispatch(Event* event) { ...@@ -255,6 +257,8 @@ void GestureInterpreterLibevdevCros::Dispatch(Event* event) {
void GestureInterpreterLibevdevCros::DispatchMouseButton(unsigned int modifier, void GestureInterpreterLibevdevCros::DispatchMouseButton(unsigned int modifier,
bool down) { bool down) {
if (!cursor_)
return; // No cursor!
const gfx::PointF& loc = cursor_->location(); const gfx::PointF& loc = cursor_->location();
int flag = modifiers_->GetEventFlagFromModifier(modifier); int flag = modifiers_->GetEventFlagFromModifier(modifier);
EventType type = (down ? ET_MOUSE_PRESSED : ET_MOUSE_RELEASED); EventType type = (down ? ET_MOUSE_PRESSED : ET_MOUSE_RELEASED);
......
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