OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cr
os.h" | 5 #include "ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cr
os.h" |
6 | 6 |
7 #include <gestures/gestures.h> | 7 #include <gestures/gestures.h> |
8 #include <libevdev/libevdev.h> | 8 #include <libevdev/libevdev.h> |
9 | 9 |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 | 257 |
258 void GestureInterpreterLibevdevCros::DispatchMouseButton(unsigned int modifier, | 258 void GestureInterpreterLibevdevCros::DispatchMouseButton(unsigned int modifier, |
259 bool down) { | 259 bool down) { |
260 if (!cursor_) | 260 if (!cursor_) |
261 return; // No cursor! | 261 return; // No cursor! |
262 const gfx::PointF& loc = cursor_->location(); | 262 const gfx::PointF& loc = cursor_->location(); |
263 int flag = modifiers_->GetEventFlagFromModifier(modifier); | 263 int flag = modifiers_->GetEventFlagFromModifier(modifier); |
264 EventType type = (down ? ET_MOUSE_PRESSED : ET_MOUSE_RELEASED); | 264 EventType type = (down ? ET_MOUSE_PRESSED : ET_MOUSE_RELEASED); |
265 modifiers_->UpdateModifier(modifier, down); | 265 modifiers_->UpdateModifier(modifier, down); |
266 MouseEvent event(type, loc, loc, modifiers_->GetModifierFlags() | flag, flag); | 266 MouseEvent event(type, loc, loc, modifiers_->GetModifierFlags() | flag, flag); |
267 Dispatch(&event); | 267 |
| 268 // This hack is necessary to trigger setting the repeat count. |
| 269 // TODO(spang): Fix it. |
| 270 MouseEvent event2(&event); |
| 271 Dispatch(&event2); |
268 } | 272 } |
269 | 273 |
270 } // namespace ui | 274 } // namespace ui |
OLD | NEW |