| 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/touch_event_converter_evdev.h" | 5 #include "ui/events/ozone/evdev/touch_event_converter_evdev.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <linux/input.h> | 9 #include <linux/input.h> |
| 10 #include <poll.h> | 10 #include <poll.h> |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 ssize_t read_size = read(fd, inputs, sizeof(inputs)); | 148 ssize_t read_size = read(fd, inputs, sizeof(inputs)); |
| 149 if (read_size < 0) { | 149 if (read_size < 0) { |
| 150 if (errno == EINTR || errno == EAGAIN) | 150 if (errno == EINTR || errno == EAGAIN) |
| 151 return; | 151 return; |
| 152 if (errno != ENODEV) | 152 if (errno != ENODEV) |
| 153 PLOG(ERROR) << "error reading device " << path_.value(); | 153 PLOG(ERROR) << "error reading device " << path_.value(); |
| 154 Stop(); | 154 Stop(); |
| 155 return; | 155 return; |
| 156 } | 156 } |
| 157 | 157 |
| 158 if (ignore_events_) |
| 159 return; |
| 160 |
| 158 for (unsigned i = 0; i < read_size / sizeof(*inputs); i++) { | 161 for (unsigned i = 0; i < read_size / sizeof(*inputs); i++) { |
| 159 ProcessInputEvent(inputs[i]); | 162 ProcessInputEvent(inputs[i]); |
| 160 } | 163 } |
| 161 } | 164 } |
| 162 | 165 |
| 163 void TouchEventConverterEvdev::ProcessInputEvent(const input_event& input) { | 166 void TouchEventConverterEvdev::ProcessInputEvent(const input_event& input) { |
| 164 if (input.type == EV_SYN) { | 167 if (input.type == EV_SYN) { |
| 165 ProcessSyn(input); | 168 ProcessSyn(input); |
| 166 } else if(syn_dropped_) { | 169 } else if(syn_dropped_) { |
| 167 // Do nothing. This branch indicates we have lost sync with the driver. | 170 // Do nothing. This branch indicates we have lost sync with the driver. |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 | 303 |
| 301 // Subsequent events for this finger will be touch-move until it | 304 // Subsequent events for this finger will be touch-move until it |
| 302 // is released. | 305 // is released. |
| 303 events_[i].type_ = ET_TOUCH_MOVED; | 306 events_[i].type_ = ET_TOUCH_MOVED; |
| 304 } | 307 } |
| 305 } | 308 } |
| 306 altered_slots_.reset(); | 309 altered_slots_.reset(); |
| 307 } | 310 } |
| 308 | 311 |
| 309 } // namespace ui | 312 } // namespace ui |
| OLD | NEW |