Commit f486b44b authored by spang's avatar spang Committed by Commit bot

ozone: evdev: gestures: Disable click when the cursor is hidden

This is hacky, and a stopgap while we wait on property plumbing.

BUG=none
TEST=manual on link_freon
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#292289}
parent 3a38fb5e
...@@ -24,6 +24,9 @@ class EVENTS_OZONE_EVDEV_EXPORT CursorDelegateEvdev { ...@@ -24,6 +24,9 @@ class EVENTS_OZONE_EVDEV_EXPORT CursorDelegateEvdev {
// Location in window. // Location in window.
virtual gfx::PointF location() = 0; virtual gfx::PointF location() = 0;
// Cursor visibility.
virtual bool IsCursorVisible() = 0;
}; };
} // namespace ui } // namespace ui
......
...@@ -254,6 +254,14 @@ void GestureInterpreterLibevdevCros::OnGestureButtonsChange( ...@@ -254,6 +254,14 @@ void GestureInterpreterLibevdevCros::OnGestureButtonsChange(
if (!cursor_) if (!cursor_)
return; // No cursor! return; // No cursor!
// HACK for disabling TTC (actually, all clicks) on hidden cursor.
// This is normally plumbed via properties and can be removed soon.
// TODO(spang): Remove this.
if (buttons->down == GESTURES_BUTTON_LEFT &&
buttons->up == GESTURES_BUTTON_LEFT &&
!cursor_->IsCursorVisible())
return;
// TODO(spang): Use buttons->start_time, buttons->end_time // TODO(spang): Use buttons->start_time, buttons->end_time
if (buttons->down & GESTURES_BUTTON_LEFT) if (buttons->down & GESTURES_BUTTON_LEFT)
DispatchMouseButton(EVDEV_MODIFIER_LEFT_MOUSE_BUTTON, true); DispatchMouseButton(EVDEV_MODIFIER_LEFT_MOUSE_BUTTON, true);
......
...@@ -58,6 +58,8 @@ gfx::AcceleratedWidget CursorFactoryEvdevDri::GetCursorWindow() { ...@@ -58,6 +58,8 @@ gfx::AcceleratedWidget CursorFactoryEvdevDri::GetCursorWindow() {
return cursor_window_; return cursor_window_;
} }
bool CursorFactoryEvdevDri::IsCursorVisible() { return cursor_; }
gfx::PointF CursorFactoryEvdevDri::location() { return cursor_location_; } gfx::PointF CursorFactoryEvdevDri::location() { return cursor_location_; }
gfx::Point CursorFactoryEvdevDri::bitmap_location() { gfx::Point CursorFactoryEvdevDri::bitmap_location() {
......
...@@ -32,6 +32,7 @@ class CursorFactoryEvdevDri : public BitmapCursorFactoryOzone, ...@@ -32,6 +32,7 @@ class CursorFactoryEvdevDri : public BitmapCursorFactoryOzone,
virtual void MoveCursorTo(gfx::AcceleratedWidget widget, virtual void MoveCursorTo(gfx::AcceleratedWidget widget,
const gfx::PointF& location) OVERRIDE; const gfx::PointF& location) OVERRIDE;
virtual void MoveCursor(const gfx::Vector2dF& delta) OVERRIDE; virtual void MoveCursor(const gfx::Vector2dF& delta) OVERRIDE;
virtual bool IsCursorVisible() OVERRIDE;
virtual gfx::PointF location() OVERRIDE; virtual gfx::PointF location() OVERRIDE;
private: private:
......
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